Redflag: safer ML by design¶
redflag
is a lightweight safety net for machinelearning. Given aDataFrame
orndarray
,redflag
will analyse the features and the target,and warn you about class imbalance, leakage, outliers,anomalous data patterns, threats to the IID assumption,and more.
Quick start¶
Install redflag
with pip or with conda
from the conda-forge
channel:
pip install redflag
Import redflag
in your Python program:
import redflag as rf
There are three main ways to use redflag
:
scikit-learn
components for your pipelines, e.g.rf.ImbalanceDetector().fit_transform(X, y)
.pandas
accessors on Series and DataFrames, e.g.df['target'].redflag.imbalance_degree()
.As a library of standalone functions, e.g.
rf.imbalance_degree(y)
.
Carry on exploring with the user guide below.