Detecting and Proving Bias in Naive Bayes
Why Naive Bayes Is Interpretable
Naive Bayes is interpretable: you can inspect every parameter — every , every — directly from the probability table. You can trace any classification decision back to which specific features contributed which specific probabilities.
The useful property: identify bias immediately by scanning the parameter table for zeros. If , that class can never be predicted when that feature is present. You can prove this mathematically with two test instances.
The problematic property: zero probabilities propagate. Multiplying small probabilities together means one zero anywhere in the product makes the entire posterior zero — the classifier becomes completely insensitive to all other evidence. A single unseen word or feature value kills the classifier for that instance.
This interpretability is impossible with black-box models (neural networks, random forests, SVMs). You cannot inspect individual parameters, trace decisions to specific training examples, or construct guaranteed counter-examples.
The 4-Step Method for Proving Bias
To mathematically demonstrate that a classifier is biased against a protected group:
- Identify a protected attribute (Gender, Ethnicity, Nationality, Age).
- Find a value of that attribute that only appears in one class in the training data (i.e., ).
- Construct two identical test instances differing ONLY in the protected attribute. All other features should appear in both classes (neutral features).
- Show that the classifier gives different predictions for the two instances, or show , meaning that class can NEVER be predicted for any instance with that protected value — regardless of all other features.
Full Worked Example: Football Academy (2024 Q9)
Training data: 6 recruits with features Goals (Many/Few/None), Position (Attack/Defender/Goalkeeper), Gender (M/F), and label Success (Y/N).
Step 1 — Priors
Step 2 — Likelihoods (MLE, no smoothing)
Goals:
Position:
Gender:
Bias Group 1: Goalkeepers (Protected: Position)
Protected value: Position = Goalkeeper. Only appears with class N in training.
Test instance: Goals=None, Position=Goalkeeper, Gender=M.
A Goalkeeper can NEVER be predicted as Successful — regardless of their Goals scored or Gender. The zero from propagates through the product and wipes out all other information.
Bias Group 2: Female Players (Protected: Gender)
Protected value: Gender = F. Only appears with class N in training.
Test instance: Goals=Many, Position=Attack, Gender=F.
A Female player can NEVER be predicted as Successful — regardless of their Goals or Position. Every is zero the moment Gender=F appears.
Why This Happened
The training data encoded historical discrimination: no Female players and no Goalkeepers appeared in the Successful group. Naive Bayes faithfully reproduced the patterns in the data. This mirrors the London Medical School Admissions case: a program built to replicate human admissions decisions reproduced the gender and ethnic discrimination present in the historical training data. “Fitting the data” does not produce fair decisions if the data itself reflects historical injustice.
Summary
| Concept | Key Point |
|---|---|
| Interpretability | Every is directly inspectable — impossible with black-box models |
| Zero propagation | One zero in the NB product kills all classification power |
| 4-step proof | Protected attribute → find exclusive value → construct test pair → show inequality |
| Goalkeeper bias | , can never predict Y |
| Gender bias | , can never predict Y |
| Root cause | Historical discrimination encoded in training data; NB faithfully reproduces it |
Past paper questions: y2024p3q9