HomeRoadmapsAI Governance Day 2
AI Governance, Fairness & Regulated Assurance Β· Day 2 Β· 20 min

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.

⚑ Runtime: Python 3.10+ Β· Zero External Dependencies (unittest)πŸ›‘οΈ AI Governance & Regulated Assurance QE Lead
FairnessDisparate ImpactEqualized OddsProxy Variables4/5ths Rule
About this lab

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.

πŸ“¦Sample Codebase & Working Solution (Day 2)Available Now
View on GitHub

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 β€” Working Solution
git clone https://github.com/777abhi/ai-governance-qe-roadmap.git
cd ai-governance-qe-roadmap/day-2-fairness-bias/test_day2.py
🏭Production Context & Regulated Implementation
πŸ’‘ Why We Are Doing This: Regulated lending, insurance, and claims systems face strict fair-treatment audits where indirect discrimination via proxy features is treated as a compliance breach.
🏒 Real-World Production Usecase: Blocking any candidate model whose disparate impact ratio falls below 0.80 or whose TPR/FPR gap across demographic cohorts exceeds 10 percentage points.
βš™οΈ How Implemented in Production: Cohort outcome evaluators and Pearson correlation proxy detector implemented in govlab/fairness.py.
Phase 1

Run & Inspect Fairness & Proxy Gates

Execute the Day 2 suite to verify both balanced and biased decision cohorts.

Step 1.1: Run Day 2 Fairness Tests
Terminal β€” Day 2 Lab
npm run test:day2
Step 1.2: Proxy-Variable Correlation Check
govlab/fairness.py
def 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)}
Day 2 Key Learnings
  • 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?