Lightweight ML drift monitoring, built for real-world pipelines
Project description
DriftWatch
📖 Documentation
Read the full documentation here: vincentcotella.github.io/DriftWatch
🚀 Features
- Multi-Drift Monitoring:
- 📊 Feature Drift: Monitor input data distribution changes (P(X)).
- 🎯 Prediction Drift: Monitor model output changes (P(Ŷ)).
- 🧠 Concept Drift: Monitor model performance degradation (P(Y|X)).
- Unified Interface:
DriftSuitecombines all monitors in one simple API. - 7 Statistical Detectors:
- PSI, KS-Test, Wasserstein, Jensen-Shannon, Anderson-Darling, Cramér-von Mises, Chi-Squared.
- Explainability: Built-in statistical explanation (
DriftExplainer) and visualization (DriftVisualizer). - Production Integrations:
- ⚡ FastAPI Middleware
- 📈 MLflow Tracking
- 🔔 Slack & Email Alerts
- Lightweight & Robust: Minimal dependencies, 100% type-safe.
📦 Installation
pip install driftwatch
For specific extras:
pip install driftwatch[viz] # Visualization support
pip install driftwatch[mlflow] # MLflow integration
pip install driftwatch[all] # CLI, API, Alerting, etc.
⚡ Quick Start
DriftWatch v0.4.0 introduces DriftSuite for unified monitoring:
from driftwatch import DriftSuite, DriftType
import pandas as pd
# 1. Initialize suite with reference data (e.g., training set)
suite = DriftSuite(
reference_data=X_train,
reference_predictions=y_val_pred,
task="classification", # or "regression"
model_version="v1.0"
)
# 2. Check production batch
report = suite.check(
production_data=X_prod,
production_predictions=y_prod_pred
)
# 3. Act on specific drift types
drift_types = report.drift_types_detected()
if DriftType.CONCEPT in drift_types:
print("🚨 CRITICAL: Concept drift detected — Retrain model!")
elif DriftType.PREDICTION in drift_types:
print("⚠️ WARNING: Prediction drift — Check model outputs.")
elif DriftType.FEATURE in drift_types:
print(f"📊 INFO: Feature drift in {report.feature_report.drifted_features()}")
else:
print("✅ All systems normal.")
🛠️ Usage Scenarios
| Scenario | Solution |
|---|---|
| Unified Monitoring | Use DriftSuite to track Feature, Prediction, and Concept drift in one go. |
| Experiment Tracking | Log all drift metrics to MLflow for long-term trend analysis. |
| Real-time API | Use DriftMiddleware in FastAPI to monitor every request. |
| Alerting | Send critical alerts via Slack or Email when model performance degrades. |
| CI/CD | Block deployments if DriftType.PREDICTION is detected in staging. |
📓 Interactive Tutorials
- Multi-Drift Tutorial — Step-by-step guide to Feature, Prediction, and Concept drift.
- Complete Showcase — Tour of all detectors, visualizers, and integrations.
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repo.
- Install dev dependencies:
pip install -e ".[dev,all]" - Run tests:
pytest - Submit a PR!
📄 License
MIT © Vincent Cotella
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file driftwatch-0.4.0.tar.gz.
File metadata
- Download URL: driftwatch-0.4.0.tar.gz
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca900fe935c6c8fbad105f67fbe0ab7572c3205d0bb05d0b3d379bc39dc64936
|
|
| MD5 |
b3ef2fc095d7623b8379b6e6e3492876
|
|
| BLAKE2b-256 |
4dd5715cd935b1e576c2de6f2c4779a05afe9b6e107039776e5dbeabcb5a136b
|
File details
Details for the file driftwatch-0.4.0-py3-none-any.whl.
File metadata
- Download URL: driftwatch-0.4.0-py3-none-any.whl
- Upload date:
- Size: 49.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b13aedec4446e92a1f33f9dd5ae45cbcd47754fc1f2ff26f68f08e4874b1fb81
|
|
| MD5 |
43af19d423b9cca11444598499e8dffe
|
|
| BLAKE2b-256 |
fad8f6635e34bff73acc3e1d6e5156ec6577e835584c173ca31b11dacd989bb1
|