A compact, self-contained demonstration notebook for bias and fairness analysis in supervised machine learning.
This repository provides a hands-on workflow for:
- training a baseline classifier,
- inspecting performance across sensitive groups,
- computing fairness indicators,
- and exploring how different modeling choices affect accuracy–fairness trade-offs.
The demo is implemented as a single Jupyter notebook and uses the Adult Income dataset.
Bias and fairness issues can appear even when a model performs well globally. Typical patterns include:
- systematic performance differences between demographic groups (e.g., higher false negative rates for one group),
- disparate rates of positive predictions (disparate impact),
- indirect discrimination caused by correlated features (proxy variables).
This notebook guides through a fairness audit in a transparent, didactic way:
- Train a baseline model
- Measure group-wise outcomes
- Quantify fairness criteria
- Discuss trade-offs and mitigation strategies
-
biasFairnessDemo.ipynb
Main notebook implementing the full demo pipeline. -
adult_income_dataset.csv
Input dataset used in the notebook (preprocessed/exported variant of the Adult dataset). -
figures/
Generated plots/illustrations used in the notebook or exported for presentations. -
requirements.txt
Python dependencies used for execution.
biasFairnessDemo/
├── figures/ # plots used/generated by the demo
├── adult_income_dataset.csv # dataset for the fairness demo
├── biasFairnessDemo.ipynb # main notebook (bias & fairness analysis workflow)
├── requirements.txt
└── README.md
git clone https://github.com/stefan-ehrlich/biasFairnessDemo.git
cd biasFairnessDemo conda create -n biasEnv python=3.10
conda activate biasEnvpip install -r requirements.txtjupyter notebook