Skip to content

A compact, self-contained demonstration notebook for bias and fairness analysis in supervised machine learning.

Notifications You must be signed in to change notification settings

stefan-ehrlich/biasFairnessDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

biasFairnessDemo

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.


What this demo illustrates

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:

  1. Train a baseline model
  2. Measure group-wise outcomes
  3. Quantify fairness criteria
  4. Discuss trade-offs and mitigation strategies

Contents

  • 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.


Repository structure

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

Installation

1. Clone the repository

git clone https://github.com/stefan-ehrlich/biasFairnessDemo.git
cd biasFairnessDemo  

2. Create python environment

conda create -n biasEnv python=3.10
conda activate biasEnv

3. Install dependencies

pip install -r requirements.txt

4. Run notebook

jupyter notebook

About

A compact, self-contained demonstration notebook for bias and fairness analysis in supervised machine learning.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published