Welcome to Frouros#

A Python library for drift detection in Machine Learning problems.

In order to start using frouros, we highly recommend to check concepts section to get a quick idea of what frouros is capable of, and what it is not yet capable of. Subsequently, we recommend taking a look at the examples section since it is the best way to start using frouros.

Read installation instructions to start using frouros.

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.

#

Warning

This library and its documentation are under heavy development.