Skip to main content
Pending implementation for the new API.

Embeddings drift

This method is coming soon to the new Evidently API! Check the old docs for now.
The default embedding drift method is a classifier. Evidently trains a binary classification model to discriminate between data from reference and current distributions.
  • The default for small data with <= 1000 observations detects drift if the ROC AUC of the drift detection classifier > possible ROC AUC of the random classifier at a 95th percentile.
  • The default for larger data with > 1000 observations detects drift if the ROC AUC > 0.55.
You can choose other embedding drift detection methods. You can specify custom thresholds and parameters such as dimensionality reduction and choose from other methods, including Euclidean distance, Cosine Similarity, Maximum Mean Discrepancy, and share of drifted embeddings. You must specify this as a parameter.
Pre-requisites:
  • You know how to generate Reports or Test Suites with default parameters.
  • You know how to pass custom parameters for Reports or Test Suites.

Default

When you calculate embeddings drift, Evidently automatically applies the default drift detection method (“model”). In Reports:
In Test Suites:
It works the same inside presets, like DataDriftPreset.

Embedding parameters - Metrics and Tests

You can override the defaults by passing a custom drift_method parameter to the relevant Metric or Test. You can define the embeddings drift detection method, the threshold, or both. Pass the drift_method parameter:

Embedding parameters - Presets

When you use NoTargetPerformanceTestPreset, DataDriftTestPreset or DataDriftPreset you can specify which subsets of columns with embeddings to include using embeddings, and the drift detection method using embeddings_drift_method. By default, the Presets will include all columns mapped as containing embeddings in column_mapping. To exclude columns with embeddings:
To specify which sets of columns to include (with the default drift detection method):
To specify which sets of columns to include, and specify the method:

Embedding drift detection methods

Currently 4 embeddings drift detection methods are available. If you specify an embedding drift detection method but do not pass additional parameters, defaults will apply. You can also specify parameters for any chosen method. Since the methods are different, each has a different set of parameters. Note that you should pass the parameters directly to the chosen drift detection method, not to the Metric.

Model-based (“model”)

Maximum mean discrepancy (“mmd”)

Share of drifted embedding components (“ratio”)

Distance-based methods (“distance”)