Redflag: safer ML by design¶
redflagis a lightweight safety net for machinelearning. Given aDataFrameorndarray,redflagwill 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-learncomponents for your pipelines, e.g.rf.ImbalanceDetector().fit_transform(X, y).pandasaccessors 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.
User guide¶
API reference¶
API reference
Other resources¶
Other resources