alibi_detect.saving.schemas
Pydantic models used by :func:~alibi_detect.utils.validate.validate_config to validate configuration dictionaries. The resolved kwarg of :func:~alibi_detect.utils.validate.validate_config determines whether the unresolved or resolved pydantic models are used:
The unresolved models expect any artefacts specified within it to not yet have been resolved. The artefacts are still string references to local filepaths or registries (e.g.
x_ref = 'x_ref.npy').The resolved models expect all artefacts to be have been resolved into runtime objects. For example,
x_refshould have been resolved into annp.ndarray.
.. note:: For detector pydantic models, the fields match the corresponding detector's args/kwargs. Refer to the detector's api docs for a full description of each arg/kwarg.
Constants
supported_models_all
supported_models_allsupported_models_all: tuple = (<class 'keras.src.models.model.Model'>, <class 'torch.nn.modules.module.Modu...Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_models_tf
supported_models_tfsupported_models_tf: tuple = (<class 'keras.src.models.model.Model'>,)Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_models_sklearn
supported_models_sklearnBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_models_torch
supported_models_torchBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_optimizers_tf
supported_optimizers_tfBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_optimizers_torch
supported_optimizers_torchBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
supported_optimizers_all
supported_optimizers_allBuilt-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.
If the argument is a tuple, the return value is the same object.
DETECTOR_CONFIGS
DETECTOR_CONFIGSDETECTOR_CONFIGS_RESOLVED
DETECTOR_CONFIGS_RESOLVEDCVMDriftConfig
CVMDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
CVMDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/cvmdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.CVMDrift documentation for a description of each field.
CVMDriftConfigResolved
CVMDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
CVMDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/cvmdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.CVMDrift documentation for a description of each field.
CVMDriftOnlineConfig
CVMDriftOnlineConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
CVMDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinecvmdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.CVMDriftOnline documentation for a description of each field.
CVMDriftOnlineConfigResolved
CVMDriftOnlineConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
CVMDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinecvmdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.CVMDriftOnline documentation for a description of each field.
ChiSquareDriftConfig
ChiSquareDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
ChiSquareDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/chisquaredrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ChiSquareDrift documentation for a description of each field.
ChiSquareDriftConfigResolved
ChiSquareDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
ChiSquareDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/chisquaredrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ChiSquareDrift documentation for a description of each field.
ClassifierDriftConfig
ClassifierDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
ClassifierDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/classifierdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ClassifierDrift documentation for a description of each field.
ClassifierDriftConfigResolved
ClassifierDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
ClassifierDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/classifierdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ClassifierDrift documentation for a description of each field.
ClassifierUncertaintyDriftConfig
ClassifierUncertaintyDriftConfigInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
ClassifierUncertaintyDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/modeluncdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ClassifierUncertaintyDrift documentation for a description of each field.
ClassifierUncertaintyDriftConfigResolved
ClassifierUncertaintyDriftConfigResolvedInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
ClassifierUncertaintyDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/modeluncdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ClassifierUncertaintyDrift documentation for a description of each field.
ContextMMDDriftConfig
ContextMMDDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
ContextMMDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/contextmmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.ContextMMDDrift documentation for a description of each field.
ContextMMDDriftConfigResolved
ContextMMDDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
MMDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/mmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.MMDDrift documentation for a description of each field.
CustomBaseModel
CustomBaseModelInherits from: BaseModel, Representation
Base pydantic model schema. The default pydantic settings are set here.
CustomBaseModelWithKwargs
CustomBaseModelWithKwargsInherits from: BaseModel, Representation
Base pydantic model schema. The default pydantic settings are set here.
DeepKernelConfig
DeepKernelConfigInherits from: CustomBaseModel, BaseModel, Representation
Unresolved schema for :class:~alibi_detect.utils.tensorflow.kernels.DeepKernel's.
DetectorConfig
DetectorConfigInherits from: CustomBaseModel, BaseModel, Representation
Base detector config schema. Only fields universal across all detectors are defined here.
DriftDetectorConfig
DriftDetectorConfigInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved base schema for drift detectors.
DriftDetectorConfigResolved
DriftDetectorConfigResolvedInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved base schema for drift detectors.
EmbeddingConfig
EmbeddingConfigInherits from: CustomBaseModel, BaseModel, Representation
Unresolved schema for text embedding models. Currently, only pre-trained
HuggingFace transformer <https://github.com/huggingface/transformers>_ models are supported.
FETDriftConfig
FETDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
FETDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/fetdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.FETDrift documentation for a description of each field.
FETDriftConfigResolved
FETDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
FETDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/fetdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.FETDrift documentation for a description of each field.
FETDriftOnlineConfig
FETDriftOnlineConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
FETDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinefetdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.FETDriftOnline documentation for a description of each field.
FETDriftOnlineConfigResolved
FETDriftOnlineConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
FETDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinefetdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.FETDriftOnline documentation for a description of each field.
KSDriftConfig
KSDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
KSDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/ksdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.KSDrift documentation for a description of each field.
KSDriftConfigResolved
KSDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
KSDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/ksdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.KSDrift documentation for a description of each field. Resolved schema for the :class:~alibi_detect.cd.KSDrift detector.
KernelConfig
KernelConfigInherits from: CustomBaseModelWithKwargs, BaseModel, Representation
Unresolved schema for kernels, to be passed to a detector's kernel kwarg.
If src specifies a :class:~alibi_detect.utils.tensorflow.GaussianRBF kernel, the sigma, trainable and init_sigma_fn fields are passed to it. Otherwise, all fields except src are passed as kwargs.
LSDDDriftConfig
LSDDDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
LSDDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/lsdddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LSDDDrift documentation for a description of each field.
LSDDDriftConfigResolved
LSDDDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
LSDDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/lsdddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LSDDDrift documentation for a description of each field.
LSDDDriftOnlineConfig
LSDDDriftOnlineConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
LSDDDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinelsdddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LSDDDriftOnline documentation for a description of each field.
LSDDDriftOnlineConfigResolved
LSDDDriftOnlineConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
LSDDDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinelsdddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LSDDDriftOnline documentation for a description of each field.
LearnedKernelDriftConfig
LearnedKernelDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
LearnedKernelDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/learnedkerneldrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LearnedKernelDrift documentation for a description of each field.
LearnedKernelDriftConfigResolved
LearnedKernelDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
LearnedKernelDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/learnedkerneldrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.LearnedKernelDrift documentation for a description of each field.
MMDDriftConfig
MMDDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
MMDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/mmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.MMDDrift documentation for a description of each field.
MMDDriftConfigResolved
MMDDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
MMDDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/mmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.MMDDrift documentation for a description of each field.
MMDDriftOnlineConfig
MMDDriftOnlineConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
MMDDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinemmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.MMDDriftOnline documentation for a description of each field.
MMDDriftOnlineConfigResolved
MMDDriftOnlineConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
MMDDriftOnline <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/onlinemmddrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.MMDDriftOnline documentation for a description of each field.
MetaData
MetaDataInherits from: CustomBaseModel, BaseModel, Representation
ModelConfig
ModelConfigInherits from: CustomBaseModel, BaseModel, Representation
Unresolved schema for (ML) models. Note that the model "backend" e.g. 'tensorflow', 'pytorch', 'sklearn', is set
by backend in :class:DetectorConfig.
OptimizerConfig
OptimizerConfigInherits from: CustomBaseModelWithKwargs, BaseModel, Representation
Unresolved schema for optimizers. The optimizer dictionary has two possible formats:
A configuration dictionary compatible with
tf.keras.optimizers.deserialize <https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/deserialize>_. Forbackend='tensorflow'only.A dictionary containing only
class_name, where this is a string referencing the optimizer name e.g.optimizer.class_name = 'Adam'. In this case, the tensorflow or pytorch optimizer class of the same name is loaded. Forbackend='tensorflow'andbackend='pytorch'.
PreprocessConfig
PreprocessConfigInherits from: CustomBaseModel, BaseModel, Representation
Unresolved schema for drift detector preprocess functions, to be passed to a detector's preprocess_fn kwarg.
Once loaded, the function is wrapped in a :func:~functools.partial, to be evaluated within the detector.
If src specifies a generic Python function, the dictionary specified by kwargs is passed to it. Otherwise, if src specifies :func:~alibi_detect.cd.tensorflow.preprocess.preprocess_drift (src='@cd.tensorflow.preprocess.preprocess_drift'), all fields (except kwargs) are passed to it.
RegressorUncertaintyDriftConfig
RegressorUncertaintyDriftConfigInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
RegressorUncertaintyDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/modeluncdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.RegressorUncertaintyDrift documentation for a description of each field.
RegressorUncertaintyDriftConfigResolved
RegressorUncertaintyDriftConfigResolvedInherits from: DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
RegressorUncertaintyDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/modeluncdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.RegressorUncertaintyDrift documentation for a description of each field.
SpotTheDiffDriftConfig
SpotTheDiffDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
SpotTheDiffDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/spotthediffdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.SpotTheDiffDrift documentation for a description of each field.
SpotTheDiffDriftConfigResolved
SpotTheDiffDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
SpotTheDiffDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/spotthediffdrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.SpotTheDiffDrift documentation for a description of each field.
SupportedDevice
SupportedDevicePydantic custom type to check the device is correct for the choice of backend (conditional on what optional deps
are installed).
Constructor
Methods
validate_device
validate_devicedevice
typing.Any
values
dict
Returns
Type:
typing.Any
SupportedModel
SupportedModelPydantic custom type to check the model is one of the supported types (conditional on what optional deps
are installed).
Constructor
Methods
validate_model
validate_modelmodel
typing.Any
values
dict
Returns
Type:
typing.Any
SupportedOptimizer
SupportedOptimizerPydantic custom type to check the optimizer is one of the supported types (conditional on what optional deps
are installed).
Constructor
Methods
validate_optimizer
validate_optimizeroptimizer
typing.Any
values
dict
Returns
Type:
typing.Any
TabularDriftConfig
TabularDriftConfigInherits from: DriftDetectorConfig, DetectorConfig, CustomBaseModel, BaseModel, Representation
Unresolved schema for the
TabularDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/tabulardrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.TabularDrift documentation for a description of each field.
TabularDriftConfigResolved
TabularDriftConfigResolvedInherits from: DriftDetectorConfigResolved, DetectorConfig, CustomBaseModel, BaseModel, Representation
Resolved schema for the
TabularDrift <https://docs.seldon.io/projects/alibi-detect/en/stable/cd/methods/tabulardrift.html>_ detector.
Except for the name and meta fields, the fields match the detector's args and kwargs. Refer to the :class:~alibi_detect.cd.TabularDrift documentation for a description of each field.
TokenizerConfig
TokenizerConfigInherits from: CustomBaseModel, BaseModel, Representation
Unresolved schema for text tokenizers. Currently, only pre-trained
HuggingFace tokenizer <https://github.com/huggingface/tokenizers>_ models are supported.
Last updated
Was this helpful?

