1. Backend (Flask API)
cd backend
pip install -r requirements.txt
python app.py
# Starts on http://localhost:50502. Frontend
Open frontend/index.html in any browser.
Or serve it: python -m http.server 3000 then visit http://localhost:3000
| Endpoint | Description |
|---|---|
| GET /api/overview | KPIs — FPR gap, recidivism rate, totals |
| GET /api/race_metrics?threshold=5 | Per-race FPR/FNR/TPR at any threshold |
| GET /api/score_distribution | Score 1-10 distribution per race |
| GET /api/threshold_sweep | FPR/FNR at all thresholds 1-10 |
| GET /api/intersectional | Race × Gender subgroup analysis |
| GET /api/model | LR + DT accuracy/AUC + feature importances |
| GET /api/sensitivity?sens_thresh=70 | Fair decision policy simulation |
| GET /api/eda | EDA — age, priors, gender breakdowns |
- AA FPR: 44.85% vs Caucasian FPR: 23.45% → 21.4pp gap
- Logistic Regression AUC: 73.79% vs COMPAS AUC: 70.22%
- Sensitivity policy (top 30% deferred): reduces FPR gap by ~5pp
- priors_count is #1 feature (56.9% importance in DT)