- You know how to use Data Definition to map column types.
- You know how to create Reports and run Tests.
Data drift parameters
Setting conditions for data drift works differently from the usual Test API (with
gt, lt, etc.) This accounts for nuances like varying role of thresholds across drift detection methods, where “greater” can be better or worse depending on the method. Dataset-level
Dataset drift share. You can set the share of drifting columns that signals dataset drift (default: 0.5) in the relevant Metrics or Presets. For example, to set it at 70%:drift_share threshold.
Column-level
For column-level metrics, you can set the drift method/threshold directly for each column:All parameters
Use the following parameters to pass chosen drift methods. See methods and their defaults below.Data drift detection methods
Tabular data
The following methods apply to tabular data: numerical or categorical columns in data definition. Pass them using thestattest (or num_stattest, etc.) parameter.
Text data
Text drift detection applies to columns with raw text data, as specified in data definition. Pass them using thestattest (or text_stattest) parameter.
Add a custom method
If you do not find a suitable drift detection method, you can implement a custom function:
The StatTest function itself should match
(reference_data: pd.Series, current_data: pd.Series, threshold: float) -> Tuple[float, bool] signature.
Accepts:
-
reference_data: pd.Series- The reference data series. -
current_data: pd.Series- The current data series to compare. -
feature_type: str- The type of feature being analyzed. -
threshold: float- The test threshold for drift detection.
-
score: float- Stat Test score (actual value) -
drift_detected: bool- indicates is drift detected with given threshold