Module 12: Fairness and Responsible AI

This module examines fairness, bias, and ethics in machine learning. You will learn how algorithmic systems can perpetuate or amplify societal biases, explore different definitions of fairness, and understand techniques for measuring and mitigating bias.

Learning Objectives

  • Identify sources of bias in ML systems (data, labels, features, algorithms).
  • Define and compare fairness criteria (demographic parity, equalized odds, calibration).
  • Explain why different fairness definitions can be mutually exclusive.
  • Measure fairness metrics across protected groups.
  • Apply bias mitigation techniques at different stages of the ML pipeline.
  • Discuss the broader societal implications of ML systems.
0 of 8 stages complete
1 · Watch

The module in two minutes

An animated overview of the module’s through-line. Watch it before the lecture — it is the map, not the territory.

Visual shorts

Short silent animations, one idea each. Press play, or open one full screen. All visual shorts

The proxy problem · full screen
2 · Listen

Orientation audio

Fairness as measurement, the impossibility trade-off, and the posture to carry into deployment.

3 · Read & play

The through-line

A model trained on history learns history's patterns — including the ones a deployment should not repeat. This module makes that concrete with a simulated hiring classifier: trained on biased outcomes, it reproduces the bias with clean code and good accuracy. Nothing malfunctioned. That is the point.

Fairness has competing definitions, and the module builds the two central ones. Demographic parity asks whether groups are selected at equal rates. Equalized odds asks whether error rates — true and false positive rates — match across groups, so qualified candidates face the same odds regardless of group. Both are computed, per group, from the confusion matrices you learned in module 5; the fairness toolkit is the measurement toolkit, pointed at people.

Then the uncomfortable mathematics: the impossibility theorem. When base rates differ between groups, several reasonable fairness criteria cannot all hold at once — not as an engineering shortfall but as arithmetic. Choosing which fairness definition to satisfy is therefore a decision about values, made explicitly or made by default. The module also demonstrates post-processing mitigation: adjusting thresholds per group to equalize the chosen metric, with visible costs elsewhere.

The professional posture this module asks of you: audit by group, not in aggregate; say which fairness definition you chose and why; and treat "the model is accurate" as the beginning of the evaluation, not the end. This is also where this course's practicum instinct lives — the systems you build will touch people who never saw the training data.

Figure · Two groups, one impossible ask

A hiring model scored two groups. Group A’s base rate is 50% qualified; group B’s is 25% — the history the model learned from. Set the thresholds and try to satisfy both fairness criteria at once.

With equal thresholds, selection rates differ — demographic parity fails — because the base rates differ. Split the thresholds to force parity and the error rates diverge instead. That is the impossibility theorem experienced rather than stated: when base rates differ, these criteria cannot all hold at once, as arithmetic, not as an engineering shortfall. The measurement toolkit is module 5’s confusion matrix, pointed at people; choosing which fairness definition to satisfy is a decision about values, made measurable.

Key concepts

  • Algorithmic Bias: Systematic unfairness in predictions
  • Protected Attributes: Legally sensitive characteristics
  • Demographic Parity: Equal positive rates across groups
  • Equalized Odds: Equal TPR and FPR across groups
  • Fairness-Accuracy Tradeoff: Tension between objectives
4 · Code

The lecture notebook

Six parts, from scratch before any framework. Run every cell; change things and rerun — the notebook is the lecture.

In Colab: File → Save a copy in Drive keeps your work.

5 · Practice

Exercise

Attempt the exercise before opening the solution — the attempt is where the learning happens.

6 · Check

Knowledge check

The quiz is self-graded and open-book. If a question surprises you, the corresponding lecture part is the fastest fix.

7 · Go deeper

Reference and discussion

8 · Done

Finish the module

Complete the stages above, then claim the finish here.