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.8.tar.gz (19.8 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.8-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydrifter-0.1.8.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

Hashes for pydrifter-0.1.8.tar.gz
Algorithm Hash digest
SHA256 a3615e80b015a9314ccc60ae19a97d985684abc2f163f212d945a79755e5cb50
MD5 c503104d6da417db09f716bd9bca1dc7
BLAKE2b-256 6f53e0f85cfdbd422b02b277c983cc4ceb19d3a269e088df1b33ea60b3ef5b84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydrifter-0.1.8-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

Hashes for pydrifter-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d93ead082fd10b61e3251cea1f4fe0380ac0b25ba571b6c3b8f8743948e35f7c
MD5 f28a93c2182e7cf4546dec23dffec8d1
BLAKE2b-256 7cf7d60b5f400d4e56ac384a9edcef3484185c2ec1f6ed58d3c357ec46ad472c

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