Skip to main content

Data drift checking for ML projects

Project description

pydrifter

An open-source framework to test and monitor ML models and systems.

PyPi Downloads License PyPi Python version

pydrifter is a lightweight, extensible Python library for detecting data drift between control and treatment datasets using statistical tests.
It is designed for Data Scientists, ML Engineers, and Analysts working with production models and experiments (A/B tests, model monitoring, etc).


🚀 What is pydrifter?

pydrifter provides a unified interface for applying and analyzing statistical tests (e.g., KS-test, Wasserstein distance, PSI, Jensen-Shannon divergence) across multiple features in tabular datasets.

It is useful for:

  • A/B testing: Detect whether experiment groups differ significantly.
  • Model monitoring: Identify drift in features over time.
  • Data quality checks: Validate dataset consistency before training or inference.

🛠️ Features

  • 🧪 Plug-and-play statistical test classes with unified API
  • 📈 Visualizations for ECDF, KS-test distances, and histograms
  • 🧹 Preprocessing config with quantile filtering
  • 🧩 Easily extendable with your own test logic
  • ✅ Built-in logging, warnings, and tabulated results

📦 Installation

pip install pydrifter

👨‍💻 Example Usage

import pandas as pd
from pydrifter.config import TableConfig
from pydrifter.calculations import KLDivergence, PSI, Wasserstein
from pydrifter import TableDrifter

data_control = pd.DataFrame({
    'age': [25, 30, 35, 40, 45],
    'salary': [50000, 60000, 70000, 80000, 90000],
})

data_treatment = pd.DataFrame({
    'age': [26, 31, 36, 41, 46],
    'salary': [51000, 61000, 71000, 81000, 91000],
})

data_config = TableConfig(numerical=['age', 'salary'], categorical=[])

drifter = TableDrifter(
    data_control=data_control,
    data_treatment=data_treatment,
    data_config=data_config,
    tests=[KLDivergence, PSI, Wasserstein]

)

result, summary = drifter.run_statistics(show_result=True)

drifter.draw("age", quantiles=[0.05, 0.95])

👥 Who is it for?

  • Data Scientists running experiments or training models
  • ML Engineers monitoring pipelines in production
  • Analysts working with control/treatment comparisons

📚 Documentation

Soon


📄 License

APACHE License © 2025 Made with ❤️ by Eugene C.

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

pydrifter-0.1.5.post1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

pydrifter-0.1.5.post1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file pydrifter-0.1.5.post1.tar.gz.

File metadata

  • Download URL: pydrifter-0.1.5.post1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.12 Darwin/24.0.0

File hashes

Hashes for pydrifter-0.1.5.post1.tar.gz
Algorithm Hash digest
SHA256 3b6fa9d23014caa598709e9dbe2105463efb084269d2ab151de5ac4dd81299f8
MD5 bf3bc7eecbc27da0e3dd46ae16c47049
BLAKE2b-256 3e0088c7f2a40303378e0a4c4466f8cc71f428024df81e04f5d88e6a48b8e181

See more details on using hashes here.

File details

Details for the file pydrifter-0.1.5.post1-py3-none-any.whl.

File metadata

  • Download URL: pydrifter-0.1.5.post1-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.12 Darwin/24.0.0

File hashes

Hashes for pydrifter-0.1.5.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a22bb9019e56b96845ab6d0af0bfa7d087c1e4cdda2f58126da3a31ad2e4f57
MD5 1bff539ded666bccfc5d9ad04157e030
BLAKE2b-256 006ad48089c7533d186286720a74ec615b4d7577de57b985132b75cbded96d7c

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