Lightweight ML drift monitoring, built for real-world pipelines
Project description
DriftWatch
📖 Documentation
Read the full documentation here: vincentcotella.github.io/DriftWatch
🚀 Features
- Simple API: Detect drift in 3 lines of code.
- Multiple Detectors: PSI, KS-Test, Wasserstein Distance, Chi-Squared.
- Production-Ready:
- ⚡ FastAPI Integration (Middleware included).
- 🔔 Slack Alerts built-in.
- 🛠️ CLI for batch processing.
- Lightweight: Minimal dependencies (
numpy,pandas,scipy). - Type-Safe: 100% typed code with
mypysupport.
📦 Installation
pip install driftwatch
For extras (CLI, FastAPI, Alerting):
pip install driftwatch[all]
⚡ Quick Start
from driftwatch import Monitor
import pandas as pd
# 1. Initialize monitor with reference data (e.g., training set)
monitor = Monitor(reference_data=pd.read_parquet("train.parquet"))
# 2. Check production data for drift
report = monitor.check(pd.read_parquet("production.parquet"))
# 3. Act on results
if report.has_drift():
print(f"⚠️ Drift detected! Ratio: {report.drift_ratio():.1%}")
print(f"Drifted features: {report.drifted_features()}")
else:
print("✅ All systems normal.")
🛠️ Usage Scenarios
| Scenario | Solution |
|---|---|
| Real-time API | Use DriftMiddleware in FastAPI to monitor every request. |
| Batch Job | Use driftwatch check CLI in your Airflow/Cron jobs. |
| CI/CD | Block deployments if validation data drifts from training data. |
| Alerting | Send Slack notifications automatically when drift is critical. |
🤝 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
driftwatch-0.3.0.tar.gz
(27.4 kB
view details)
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.3.0.tar.gz.
File metadata
- Download URL: driftwatch-0.3.0.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6949ed7148779936fc0c59ba40e7421d4e57ee390f41db09d38eadd6a31df0
|
|
| MD5 |
eb22293898dec29110e521ebb1725165
|
|
| BLAKE2b-256 |
49b8848f80e6f12eebb21fbe75ccc94a539ad5c72237b875601f2dc3908da5f0
|
File details
Details for the file driftwatch-0.3.0-py3-none-any.whl.
File metadata
- Download URL: driftwatch-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.8 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 |
33e950282d0492b1912cc9fd6ba64d2c1e66827a5ede51b42c962c433b9566d1
|
|
| MD5 |
957d0fd2fce79c67a4e52dbca1742cc7
|
|
| BLAKE2b-256 |
7b08f28c13c4ede5eedd90cd44c28e989bb136e25bc6354c0650188f2716052a
|