An algorithmic-bias audit of ~800k U.S. mortgage applications: predict loan approval, quantify demographic disparity across racial groups, then apply fairness-constrained optimization and measure the accuracy–fairness tradeoff.
Interactive demo: fairlensweb.vercel.app — adjust an applicant and watch the approval decision shift by race, with live disparate-impact charts and a Fairlearn debiasing walkthrough.
This project investigates algorithmic fairness in mortgage loan approval prediction using the 2024 Home Mortgage Disclosure Act (HMDA) dataset.
We build and evaluate multiple machine learning models to predict loan approval outcomes and quantify demographic disparities across racial groups. We further implement a fairness-constrained optimization method to reduce bias while analyzing the resulting accuracy–fairness tradeoff.
This project sits at the intersection of:
- Applied Machine Learning
- Responsible AI
- Financial Risk Modeling
- Regulatory-Aligned AI Systems
Automated credit decision systems can unintentionally reproduce or amplify historical lending disparities.
This project answers three key questions:
- Can we accurately predict mortgage approval outcomes using structured financial and demographic data?
- Do high-performing ML models exhibit measurable demographic disparities?
- Can fairness-constrained optimization reduce bias while preserving predictive performance?
- Source: 2024 HMDA Public LAR dataset (FFIEC)
- Records used: ~800,000 loan applications
- States analyzed: New Jersey (NJ) and Georgia (GA)
- Features: 36 domain-selected underwriting attributes
- Final feature space after encoding: 114 features
Target Variable:
approved(binary loan approval outcome derived from action_taken codes)
Sensitive Attributes Evaluated:
- Race
- Sex
- Ethnicity
- Data Cleaning & Filtering (NJ and GA subset)
- Domain-driven feature selection
- Missing value imputation (median/mode)
- One-hot encoding for categorical variables
- Standard scaling for numeric features
- Stratified train-test split (70/30)
- Model training
- Fairness evaluation
- Fairness-constrained optimization
- Logistic Regression
- XGBoost (hist-based gradient boosting)
- Feed-forward Neural Network (Keras, GPU-enabled)
- Fair-XGB (Exponentiated Gradient Reduction with Demographic Parity constraint using Fairlearn)
We evaluate group fairness using:
Difference in positive prediction rates between privileged and unprivileged groups.
Difference in true positive and false positive rates across demographic groups.
| Model | Accuracy | DPD (Race) | EOD (Race) |
|---|---|---|---|
| LR | 0.983 | 0.272 | 0.015 |
| XGBoost | 0.995 | 0.270 | 0.012 |
| Neural Net | 0.989 | 0.266 | 0.011 |
| Fair-XGB | 0.939 | 0.128 | 0.226 |
- High predictive accuracy does not imply fairness.
- Baseline models exhibited significant demographic disparities.
- Fair-XGB reduced Demographic Parity Difference by ~53%.
- Fairness improvements resulted in measurable accuracy tradeoff.
- Bias levels were comparable across NJ and GA, suggesting systemic patterns rather than region-specific effects.
- GPU-accelerated training (NVIDIA A6000)
- Custom fairness reporting functions
- State-level subgroup analysis
- Hyperparameterized feature subset experimentation
- Integration of Fairlearn’s Exponentiated Gradient reduction
The fairness-constrained model significantly reduces demographic parity disparity but increases Equalized Odds difference and decreases overall accuracy.
This demonstrates the real-world tension between predictive performance and regulatory-aligned fairness constraints in financial systems.
Final_fixed.ipynb— full analysis: cleaning, feature selection, modeling, fairness evaluation, and constrained optimizationFinal Report.pdf— written reportREADME.mdstate_mortgage_data.csv— not included (size constraint); download the HMDA data as described below
Due to size constraints, the full HMDA dataset is not included in this repository.
The 2024 HMDA Public LAR dataset can be downloaded from: https://ffiec.cfpb.gov/data-publication/
After downloading, filter to NJ and GA as shown in the notebook.
This work is directly relevant to:
- FinTech risk modeling
- Responsible AI initiatives
- Fair lending compliance (ECOA, CFPB alignment)
- Model risk management frameworks
The project demonstrates how fairness-aware optimization can be integrated into production ML pipelines for high-stakes decision systems.
- Intersectional fairness analysis (e.g., race × gender)
- Equalized Odds constrained optimization
- Causal fairness modeling
- Feature-level bias attribution via SHAP
- Real-time fairness monitoring dashboards
- Python
- Pandas / NumPy
- Scikit-learn
- XGBoost
- TensorFlow / Keras
- Fairlearn
- Matplotlib / Seaborn
Shauryaditya Singh
Master’s in Applied Artificial Intelligence (Data Engineering)
Stevens Institute of Technology
Focus Areas: Applied ML • Responsible AI • FinTech Analytics • Optimization Systems