alibi_detect.base module
- class alibi_detect.base.BaseDetector[source]
Bases:
ABC
Base class for outlier, adversarial and drift detection algorithms.
- class alibi_detect.base.ConfigurableDetector(*args, **kwargs)[source]
-
Type Protocol for detectors that have support for saving via config.
Used for typing save and load functionality in alibi_detect.saving.saving.
- class alibi_detect.base.Detector(*args, **kwargs)[source]
Bases:
Protocol
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.
- class alibi_detect.base.DriftConfigMixin[source]
Bases:
object
A mixin class containing methods related to a drift detector’s configuration dictionary.
- class alibi_detect.base.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]
Bases:
JSONEncoder
- default(obj)[source]
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
- class alibi_detect.base.StatefulDetectorOnline(*args, **kwargs)[source]
Bases:
ConfigurableDetector
,Protocol
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.