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.preprocessing 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

MIT 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.4.tar.gz (15.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.4-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydrifter-0.1.4.tar.gz
  • Upload date:
  • Size: 15.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.4.tar.gz
Algorithm Hash digest
SHA256 03d59471e4e8b6fd717d2a10a91565995b90d52fe91ad390659e3749399465a1
MD5 8be652fbdd579e2eec1882ffa01fa6ed
BLAKE2b-256 64b2e022a7fed9e17af37cea2b43fcd05a71e15b1cca6f897567989e02353539

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydrifter-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 21.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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d10d600603377013358ff3e965a79add9394e7f7ee8a83cd7ab9ba08ae485b1e
MD5 7779498fa8451c95fe905eef03375ff0
BLAKE2b-256 ea7ce266a4b7b33e3770e7ecd04d14151900a8bb47041f9e5dbeede4c74868a7

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