Data drift checking for ML projects
Project description
pydrifter
An open-source framework to test and monitor ML models and systems.
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
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
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 pydrifter-0.1.7.tar.gz.
File metadata
- Download URL: pydrifter-0.1.7.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.12 Darwin/24.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6129b873619bffe312d61d267e59292cad10e8512e43cf66b4c723981ac5c6c
|
|
| MD5 |
5946926270e5c0c4b012cacef24de612
|
|
| BLAKE2b-256 |
5af83fc029e5e57a1de74fccf92e482e98d4ad00f95b21f9654675285e7e3e52
|
File details
Details for the file pydrifter-0.1.7-py3-none-any.whl.
File metadata
- Download URL: pydrifter-0.1.7-py3-none-any.whl
- Upload date:
- Size: 27.1 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffaca2eb8b1e24218ddf5640c44b0157476271b0ae5029ad1ae6f915a484bece
|
|
| MD5 |
e176f5e6ec0d3767455dce1aff9c3dd1
|
|
| BLAKE2b-256 |
2cdac954df44130144f7042cc22f441b0b2829642e01e4d00a8d6b88ace3447f
|