Skip to main content

A Python library for drift detection in Machine Learning problems

Project description

ci coverage documentation bsd_3_license

Frouros is a Python library for drift detection in Machine Learning problems.

Frouros provides a combination of classical and more recent algorithms for drift detection, both for detecting concept and data drift.

Quickstart

As a quick and easy example, we can generate two normal distributions in order to use a data drift detector like Kolmogorov-Smirnov. This method tries to verify if generated samples come from the same distribution or not. If they come from different distributions, it means that there is data drift.

import numpy as np
from frouros.detectors.data_drift import KSTest

np.random.seed(31)
# X samples from a normal distribution with mean=2 and std=2
x_mean = 2
x_std = 2
# Y samples a normal distribution with mean=1 and std=2
y_mean = 1
y_std = 2

num_samples = 10000
X_ref = np.random.normal(x_mean, x_std, num_samples)
X_test = np.random.normal(y_mean, y_std, num_samples)

alpha = 0.01  # significance level for the hypothesis test

detector = KSTest()
detector.fit(X=X_ref)
statistic, p_value = detector.compare(X=X_test)

p_value < alpha
>> > True  # Drift detected. We can reject H0, so both samples come from different distributions.

More examples can be found here.

Installation

Frouros supports Python 3.8, 3.9 and 3.10 versions. It can be installed via pip:

pip install frouros

Drift detection methods

The currently implemented detectors are listed in the following diagram.

Detectors diagram

Datasets

Some well-known datasets and synthetic generators are provided and listed in the following diagram.

Datasets diagram

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

frouros-0.2.0.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

frouros-0.2.0-py3-none-any.whl (91.6 kB view details)

Uploaded Python 3

File details

Details for the file frouros-0.2.0.tar.gz.

File metadata

  • Download URL: frouros-0.2.0.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for frouros-0.2.0.tar.gz
Algorithm Hash digest
SHA256 92ec77e5379330b243ded39af93acd5830b431b070700a4d0111a4e78dc49922
MD5 66ea20806ee8510d5d237c03f16d23f7
BLAKE2b-256 d4bc2f4b91078f922bbf46e569b360ad924f54cf8f12470a22113251df19f186

See more details on using hashes here.

File details

Details for the file frouros-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: frouros-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 91.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for frouros-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6425007fdec21279828ee42a470a7849b5f309e3994b389863786c6689ab47e2
MD5 136df9764c395734f098a846d1544021
BLAKE2b-256 8daf3d1988f53709b4ba0e979e9bed3baea6af9e64ef1cd1e4db3ec65c2f02b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page