Skip to main content
evidently-drift-detector Evidently AI skill for data drift detection, model performance monitoring, target drift analysis, and automated reporting for ML systems in production.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/a5c-ai/babysitter --skill evidently-drift-detectorThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... More from this repository
Related occupations SOC
Based on SOC occupation classification
Reference for querying the Atlas knowledge graph through its MCP tools — the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
assimilate-popular-workflows This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.
name evidently-drift-detector description Evidently AI skill for data drift detection, model performance monitoring, target drift analysis, and automated reporting for ML systems in production. allowed-tools Read, Grep, Write, Bash, Edit, Glob graph {"domains":["domain:data-science"],"specializations":["specialization:data-science-ml"],"skillAreas":["skill-area:model-monitoring-drift-detection","skill-area:data-quality-testing"],"roles":["role:ml-ops-engineer","role:data-scientist"],"workflows":["workflow:data-quality-monitoring"]}
Evidently Drift Detector
Detect data drift, monitor model performance, and generate automated reports using Evidently AI.
Overview
This skill provides comprehensive capabilities for ML monitoring using Evidently AI. It enables detection of data drift, concept drift, target drift, and model performance degradation in production ML systems.
Capabilities
Data Drift Detection
Feature-level drift detection
Dataset-level drift analysis
Multiple drift detection methods (KS, PSI, Wasserstein, etc.)
Distribution visualization
Drift magnitude quantification
Model Performance Monitoring
Classification metrics tracking
Regression metrics tracking
Performance degradation detection
Slice-based analysis
Error analysis
Target Drift Analysis
Target distribution changes
Label drift detection
Prediction drift monitoring
Class balance monitoring
Automated Reporting
HTML report generation
JSON metrics export
Dashboard integration
Custom metric creation
Test suite execution
Production Monitoring
Real-time monitoring integration
Alerting threshold configuration
Time-series drift tracking
Batch comparison analysis
Prerequisites
Installation pip install evidently>=0.4.0
Optional Dependencies
pip install evidently[spark]
pip install plotly nbformat
Usage Patterns
Basic Data Drift Report from evidently import ColumnMapping
from evidently.report import Report
from evidently.metric_preset import DataDriftPreset
column_mapping = ColumnMapping(
target='target' ,
prediction='prediction' ,
numerical_features=['feature_1' , 'feature_2' , 'feature_3' ],
categorical_features=['category_1' , 'category_2' ]
)
report = Report(metrics=[
DataDriftPreset()
])
report.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
report.save_html("drift_report.html" )
metrics_dict = report.as_dict()
Classification Performance Report from evidently.metric_preset import ClassificationPreset
report = Report(metrics=[
ClassificationPreset()
])
report.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
results = report.as_dict()
accuracy = results['metrics' ][0 ]['result' ]['current' ]['accuracy' ]
Regression Performance Report from evidently.metric_preset import RegressionPreset
report = Report(metrics=[
RegressionPreset()
])
report.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
Test Suite for Automated Checks from evidently.test_suite import TestSuite
from evidently.test_preset import DataDriftTestPreset, DataQualityTestPreset
test_suite = TestSuite(tests=[
DataDriftTestPreset(),
DataQualityTestPreset()
])
test_suite.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
if test_suite.as_dict()['summary' ]['all_passed' ]:
print ("All tests passed!" )
else :
failed_tests = [t for t in test_suite.as_dict()['tests' ] if t['status' ] == 'FAIL' ]
print (f"Failed tests: {len (failed_tests)} " )
Individual Drift Metrics from evidently.metrics import (
DatasetDriftMetric,
ColumnDriftMetric,
DataDriftTable,
TargetByFeaturesTable
)
report = Report(metrics=[
DatasetDriftMetric(),
ColumnDriftMetric(column_name='feature_1' ),
ColumnDriftMetric(column_name='feature_2' ),
DataDriftTable(),
TargetByFeaturesTable()
])
report.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
Custom Drift Thresholds from evidently.metrics import DatasetDriftMetric
from evidently.options import DataDriftOptions
options = DataDriftOptions(
drift_share=0.5 ,
stattest='psi' ,
stattest_threshold=0.1
)
report = Report(metrics=[
DatasetDriftMetric(options=options)
])
Time-Series Monitoring import pandas as pd
from datetime import datetime, timedelta
def monitor_over_time (reference_df, production_data_stream, window_days=7 ):
"""Monitor drift over time windows."""
results = []
for window_start in production_data_stream:
window_end = window_start + timedelta(days=window_days)
current_window = production_data_stream.query(
f"timestamp >= '{window_start} ' and timestamp < '{window_end} '"
)
report = Report(metrics=[DataDriftPreset()])
report.run(reference_data=reference_df, current_data=current_window)
metrics = report.as_dict()
results.append({
'window_start' : window_start,
'drift_detected' : metrics['metrics' ][0 ]['result' ]['dataset_drift' ],
'drift_share' : metrics['metrics' ][0 ]['result' ]['drift_share' ]
})
return pd.DataFrame(results)
Integration with Babysitter SDK
Task Definition Example const driftDetectionTask = defineTask ({
name : 'evidently-drift-detection' ,
description : 'Detect data drift between reference and current data' ,
inputs : {
referenceDataPath : { type : 'string' , required : true },
currentDataPath : { type : 'string' , required : true },
targetColumn : { type : 'string' },
predictionColumn : { type : 'string' },
numericalFeatures : { type : 'array' },
categoricalFeatures : { type : 'array' },
driftThreshold : { type : 'number' , default : 0.5 }
},
outputs : {
driftDetected : { type : 'boolean' },
driftShare : { type : 'number' },
driftedFeatures : { type : 'array' },
reportPath : { type : 'string' }
},
async run (inputs, taskCtx ) {
return {
kind : 'skill' ,
title : 'Detect data drift' ,
skill : {
name : 'evidently-drift-detector' ,
context : {
operation : 'detect_drift' ,
referenceDataPath : inputs.referenceDataPath ,
currentDataPath : inputs.currentDataPath ,
targetColumn : inputs.targetColumn ,
predictionColumn : inputs.predictionColumn ,
numericalFeatures : inputs.numericalFeatures ,
categoricalFeatures : inputs.categoricalFeatures ,
driftThreshold : inputs.driftThreshold
}
},
io : {
inputJsonPath : `tasks/${taskCtx.effectId} /input.json` ,
outputJsonPath : `tasks/${taskCtx.effectId} /result.json`
}
};
}
});
Available Presets
Metric Presets Preset Use Case DataDriftPresetFeature drift detection DataQualityPresetData quality checks ClassificationPresetClassification model performance RegressionPresetRegression model performance TargetDriftPresetTarget variable drift TextOverviewPresetText data analysis
Test Presets Preset Use Case DataDriftTestPresetAutomated drift tests DataQualityTestPresetData quality validation DataStabilityTestPresetData stability checks NoTargetPerformanceTestPresetProxy performance tests RegressionTestPresetRegression performance tests MulticlassClassificationTestPresetMulticlass tests BinaryClassificationTestPresetBinary classification tests
Statistical Tests Available Test Method Best For ksKolmogorov-Smirnov Numerical, general psiPopulation Stability Index Production monitoring wassersteinWasserstein distance Distribution comparison jensenshannonJensen-Shannon divergence Probability distributions chisquareChi-square Categorical features zZ-test Large samples, normal kl_divKL divergence Information theory
ML Pipeline Integration
Retraining Trigger def check_retraining_needed (reference_df, current_df, column_mapping, threshold=0.3 ):
"""Determine if model retraining is needed based on drift."""
from evidently.test_suite import TestSuite
from evidently.tests import TestShareOfDriftedColumns
test_suite = TestSuite(tests=[
TestShareOfDriftedColumns(lt=threshold)
])
test_suite.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
results = test_suite.as_dict()
retraining_needed = not results['summary' ]['all_passed' ]
return {
'retraining_needed' : retraining_needed,
'drift_share' : results['tests' ][0 ]['result' ]['current' ],
'threshold' : threshold
}
Performance Degradation Alert def check_performance_degradation (reference_df, current_df, column_mapping, min_accuracy=0.85 ):
"""Alert if classification accuracy drops below threshold."""
from evidently.tests import TestAccuracyScore
test_suite = TestSuite(tests=[
TestAccuracyScore(gte=min_accuracy)
])
test_suite.run(
reference_data=reference_df,
current_data=current_df,
column_mapping=column_mapping
)
results = test_suite.as_dict()
return {
'degradation_detected' : not results['summary' ]['all_passed' ],
'current_accuracy' : results['tests' ][0 ]['result' ]['current' ],
'threshold' : min_accuracy
}
Best Practices
Establish Baselines : Use production data as reference, not training data
Choose Appropriate Tests : Match statistical tests to data types
Set Meaningful Thresholds : Balance sensitivity vs. alert fatigue
Monitor Feature Importance : Focus on high-impact features
Time-Based Comparison : Compare similar time periods
Document Decisions : Record why certain drift is acceptable
References