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.3.0.tar.gz (27.4 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.3.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

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

Hashes for driftwatch-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bb6949ed7148779936fc0c59ba40e7421d4e57ee390f41db09d38eadd6a31df0
MD5 eb22293898dec29110e521ebb1725165
BLAKE2b-256 49b8848f80e6f12eebb21fbe75ccc94a539ad5c72237b875601f2dc3908da5f0

See more details on using hashes here.

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

Hashes for driftwatch-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33e950282d0492b1912cc9fd6ba64d2c1e66827a5ede51b42c962c433b9566d1
MD5 957d0fd2fce79c67a4e52dbca1742cc7
BLAKE2b-256 7b08f28c13c4ede5eedd90cd44c28e989bb136e25bc6354c0650188f2716052a

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