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

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 import TableDriftChecker
from pydrifter.calculations import KS, Wasserstein, PSI
from pydrifter.config import DataConfig

# Define control and treatment datasets
control_df = pd.read_csv("data/control.csv")
treatment_df = pd.read_csv("data/treatment.csv")

# Configure features
data_config = DataConfig(
    numerical=["age", "salary", "click_rate"],
    categorical=["device_type"]
)

# Initialize drift checker
checker = TableDriftChecker(
    data_control=control_df,
    data_treatment=treatment_df,
    data_config=data_config
)

# Run statistical tests
checker.run_statistics(
    tests=[KS, Wasserstein, PSI],
    show_result=True
)

👥 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.tar.gz (15.3 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-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydrifter-0.1.5.tar.gz
  • Upload date:
  • Size: 15.3 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.tar.gz
Algorithm Hash digest
SHA256 03ac32a0db3708ee1e50c02799d846527a04d3ea77fc1cb4b98d8198a925c375
MD5 f8b05b50e78e9acc602950595036fafd
BLAKE2b-256 fb6fc770be205d67f455745d768d356f8e0d25fec8a5cc3beae98070a91e3c11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydrifter-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 21.4 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-py3-none-any.whl
Algorithm Hash digest
SHA256 e37746339c29cd07bd638c9ffda061041b73547b6ca1898127b545a17ddb1174
MD5 983fff4cc20140a902f5733c1ed67183
BLAKE2b-256 a2bd05ec8fca6ee9b1c620c89c5e4dbc7b94757e6e2135c7fc66cb642b04513a

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