Lessons › Chapter 14: ML in practice
Fairness and responsible ML
A model can look accurate overall while treating groups of people very differently. fairness work starts by measuring approvals and mistakes separately for each group.
Watch it move. This lesson is interactive on Gradient Lab: every step is an animated scene you can replay.
Start the interactive lessonStep by step
Fair to everyone
Before launching the loan model, Maya checks that it treats different groups of customers fairly. Next stop: launching Pip (Chapter 15).
Measure results by group
A model can look accurate overall while treating groups of people very differently. fairness work starts by measuring approvals and mistakes separately for each group.
A gap appears
Suppose equally qualified applicants from group B are approved far less often. That gap is a red flag, even though nobody told the model about groups at all.
Find the cause
Common causes: the history the model learned from was itself unfair; one group is underrepresented in the data; or a feature like postcode acts as a proxy for a sensitive attribute.
Fix it, and keep watching
Remedies include better and more balanced data, removing proxy features, adjusting decision thresholds and adding human review for borderline cases. Then keep measuring after launch, because fairness can drift too.
In real life: a hiring tool that learned the past
One widely reported recruiting model learned to mark down CVs that mentioned women’s clubs, because it was trained on years of mostly male hiring decisions. The company dropped it. Models copy the patterns in their data, including the unfair ones, unless people check.
Quick check: A model approves 80% of group A but 50% of equally qualified group B. What comes first?
- Investigate the data and features for the cause (correct)
- Ignore it: overall accuracy is fine
- Remove group B from the data
A large unexplained gap needs investigating: biased history, imbalance or proxy features are common culprits.
Pseudocode
for each group (for example by age band or region):
approval_rate = approvals / applicants
error_rate = mistakes / applicants
if the gaps are large:
find the cause: unbalanced data? proxy features? biased labels?
fix: better data, remove proxies, adjust thresholds, human review
keep measuring after launch
Key terms
- fairness
- Checking that a model’s errors and decisions don’t unfairly disadvantage particular groups of people.
- proxy
- A feature that quietly stands in for a sensitive one, like a postcode standing in for ethnicity or income.