alibi_detect.base

Constants

DEFAULT_META

DEFAULT_META: dict = {'name': None, 'online': None, 'data_type': None, 'version': None, 'detector_...

LARGE_ARTEFACTS

LARGE_ARTEFACTS: list = ['x_ref', 'c_ref', 'preprocess_fn']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

BaseDetector

Inherits from: ABC

Base class for outlier, adversarial and drift detection algorithms.

Constructor

BaseDetector(self)

Properties

Property
Type
Description

meta

Dict

Methods

predict

predict(X: numpy.ndarray)
Name
Type
Default
Description

X

numpy.ndarray

score

score(X: numpy.ndarray)
Name
Type
Default
Description

X

numpy.ndarray

ConfigurableDetector

Inherits from: Detector, Protocol, Generic

Type Protocol for detectors that have support for saving via config.

Used for typing save and load functionality in alibi_detect.saving.saving.

Methods

from_config

from_config(config: dict)
Name
Type
Default
Description

config

dict

get_config

get_config() -> dict

Returns

  • Type: dict

Detector

Inherits from: Protocol, Generic

Type Protocol for all detectors.

Used for typing legacy save and load functionality in alibi_detect.saving._tensorflow.saving.py.

Note

This exists to distinguish between detectors with and without support for config saving and loading. Once all
detector support this then this protocol will be removed.

Constructor

Detector(self, *args, **kwargs)

Methods

predict

predict() -> typing.Any

Returns

  • Type: typing.Any

DriftConfigMixin

A mixin class containing methods related to a drift detector's configuration dictionary.

Constructor

DriftConfigMixin(self, /, *args, **kwargs)

Methods

from_config

from_config(config: dict)

Instantiate a drift detector from a fully resolved (and validated) config dictionary.

Name
Type
Default
Description

config

dict

A config dictionary matching the schema's in :class:~alibi_detect.saving.schemas.

get_config

get_config() -> dict

Get the detector's configuration dictionary.

Returns

  • Type: dict

FitMixin

Inherits from: ABC

Methods

fit

fit(args, kwargs) -> None

Returns

  • Type: None

NumpyEncoder

Inherits from: JSONEncoder

Methods

default

default(obj)
Name
Type
Default
Description

obj

StatefulDetectorOnline

Inherits from: ConfigurableDetector, Detector, Protocol, Generic

Type Protocol for detectors that have support for save/loading of online state.

Used for typing save and load functionality in alibi_detect.saving.saving.

Methods

load_state

load_state(filepath: Union[str, os.PathLike])
Name
Type
Default
Description

filepath

Union[str, os.PathLike]

save_state

save_state(filepath: Union[str, os.PathLike])
Name
Type
Default
Description

filepath

Union[str, os.PathLike]

ThresholdMixin

Inherits from: ABC

Methods

infer_threshold

infer_threshold(args, kwargs) -> None

Returns

  • Type: None

Functions

adversarial_correction_dict

adversarial_correction_dict()

adversarial_prediction_dict

adversarial_prediction_dict()

concept_drift_dict

concept_drift_dict()

outlier_prediction_dict

outlier_prediction_dict()

Last updated

Was this helpful?