Redflag: safer ML by design¶

redflag is a lightweight safety net for machine
learning. Given a DataFrame or ndarray,
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:

  1. scikit-learn components for your pipelines, e.g. rf.ImbalanceDetector().fit_transform(X, y).

  2. pandas accessors on Series and DataFrames, e.g. df['target'].redflag.imbalance_degree().

  3. As a library of standalone functions, e.g. rf.imbalance_degree(y).

Carry on exploring with the user guide below.

User guide¶

API reference¶

Other resources¶

Indices and tables¶