Skip to main content

DriftWatch

Lightweight ML drift monitoring, built for real-world pipelines

Documentation CI PyPI version Python 3.9+ License: MIT


📖 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: DriftSuite combines 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

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repo.
  2. Install dev dependencies: pip install -e ".[dev,all]"
  3. Run tests: pytest
  4. Submit a PR!

📄 License

MIT © Vincent Cotella

Release files for driftwatch 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for driftwatch 0.4.0
File Size Uploaded
driftwatch-0.4.0.tar.gz 46.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for driftwatch 0.4.0
File Interpreter ABI Platform
driftwatch-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size:95.9 kB

Release files / driftwatch-0.4.0.tar.gz

Download URL driftwatch-0.4.0.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ca900fe935c6c8fbad105f67fbe0ab7572c3205d0bb05d0b3d379bc39dc64936
BLAKE2b-256 checksum
How to use checksums
4dd5715cd935b1e576c2de6f2c4779a05afe9b6e107039776e5dbeabcb5a136b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / driftwatch-0.4.0-py3-none-any.whl

Download URL driftwatch-0.4.0-py3-none-any.whl
Size 49.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b13aedec4446e92a1f33f9dd5ae45cbcd47754fc1f2ff26f68f08e4874b1fb81
BLAKE2b-256 checksum
How to use checksums
fad8f6635e34bff73acc3e1d6e5156ec6577e835584c173ca31b11dacd989bb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page