Skip to main content

Lightweight ML drift monitoring, built for real-world pipelines

Project description

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

  • 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 mypy support.

📦 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.

  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

Project details


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.2.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

driftwatch-0.2.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file driftwatch-0.2.0.tar.gz.

File metadata

  • Download URL: driftwatch-0.2.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for driftwatch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab658a5bbeaf876bc7dbe81d7e8d3ab36e00c1e95ca33b179d5e56f47b37f17f
MD5 129fc34829aba0bdf21c6d33c91b1c78
BLAKE2b-256 d3c70ffe0b48d6f45a9b2acd263c0f1208b20c03b9a8a520170f580f1300540b

See more details on using hashes here.

File details

Details for the file driftwatch-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: driftwatch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for driftwatch-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b77c15c871f24a9c570319523f9323bfc7bd22c0a333807eda2529b2d307298
MD5 fadb1da5e0ac5a18bfea1fb2d2ec896e
BLAKE2b-256 939519fc376c000fb409768f0c3aaf2f25235ef096842ee30f1f9e0f9c7b03f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page