Algorithmic Fairness & Proxy Detection
AI Governance, Fairness & Regulated Assurance β Day 2
Audit automated decisioning across demographic cohorts using Demographic Parity Difference, the 4/5ths Disparate Impact rule, Equalized Odds (TPR/FPR gaps), and proxy-variable correlation detection.
Removing protected attributes from a model does not eliminate bias when correlated proxies such as postal code tiers remain in the feature set. Today you will run automated fairness gates checking Demographic Parity, Disparate Impact (4/5ths rule), Equalized Odds, and Pearson proxy correlations.
The official reference codebase for Day 2 is hosted in the repository. Clone the repository and navigate to day-2-fairness-bias/test_day2.py to run the working solution.
git clone https://github.com/777abhi/ai-governance-qe-roadmap.git
cd ai-governance-qe-roadmap/day-2-fairness-bias/test_day2.pyRun & Inspect Fairness & Proxy Gates
Execute the Day 2 suite to verify both balanced and biased decision cohorts.
npm run test:day2def detect_proxy_variables(features, protected_indicator, threshold: float = 0.60):
correlations = {}
flagged = []
for name, values in features.items():
r = pearson_correlation(values, protected_indicator)
correlations[name] = r
if abs(r) >= threshold:
flagged.append(name)
return {"passed": len(flagged) == 0, "flagged_proxies": sorted(flagged)}- Measured Demographic Parity Difference (DPD) and Disparate Impact Ratio against the 0.80 (4/5ths) threshold.
- Audited Equalized Odds by checking both True Positive Rate and False Positive Rate gaps across cohorts.
- Detected hidden proxy variables correlated with protected attributes using Pearson correlation.
π§ Knowledge Check
Why is simply dropping protected demographic columns insufficient to guarantee a fair decision model?