Back to projects
shippedlive demo

Loan Default Fairness

A profit-optimized credit risk model.

Built on 1.3M LendingClub loans, this project develops a profit-aware credit risk model that replaces accuracy with expected profit as the deployment objective. It combines temporal validation, probability calibration, explainability, and a fairness audit to evaluate the business trade-offs behind lending decisions.

Expected Profit+$30.9M
Held-out AUC0.719
Deployment Threshold0.1592
LightGBMOptunaFairlearnSHAPisotonic
how.it.works

How it works

Dataset1.3Mcompleted loans
Time split2014 → 17train · validation · hold-out
Leakage128 → 79features, −49 post-decision
ModelLightGBMOptuna · isotonic calibration
Decision0.1592threshold · +10 / −50 basis
AuditSHAPfairness · profit
+$30.86M

Expected profit on 2017 — a year the model never saw, from a decision rule tuned for money instead of accuracy. $182.26 per loan.

0.7188out-of-time AUCheld from 0.7281
0.1592deployed thresholdbreak-even 0.1667
$2.4–5.7Mcost of fairness3.7–8.7% of profit
01

Why profit, not accuracy

A repaid loan returns about +10% of principal. A default loses about −50%. The two mistakes are not equally expensive — a five-to-one asymmetry.

A model tuned for accuracy treats them as interchangeable. One tuned for profit doesn’t — it rejects aggressively to avoid the costly approvals.

That single choice sets the threshold and shapes the fairness problem that surfaces later.

repaid+10%
default−50%
return on every dollar of principal · a 5-to-1 asymmetry
02

Would this borrower be approved?

Change the profile and watch the decision flip at the deployed cutoff. Each bar is a feature pushing default risk up or down — the same idea as a SHAP explanation.

income tier
home ownership
employment3 y
debt-to-income22%
loan amount15k
predicted default probability
28.7%
0%cutoff 15.92%
✕ Rejected
what moved the decision
home ownership
+0.60
income tier
+0.40
employment length
-0.12
debt-to-income
+0.08
loan amount
+0.03
03

The metrics held, the profit didn’t

On 2017, ranking and calibration barely moved — AUC 0.7281 → 0.7188, Brier almost flat. The threshold held too: re-tuning on the real labels recovers just 1.4%.

And yet, per-loan profit slipped. Statistical health hid an economic softening.

−18.5%per-loan profit, 2016 → 2017 — which is why profit has to be monitored directly, not inferred from AUC.
04

Who gets rejected

One profit-optimal threshold rejects unevenly. Disadvantage compounds where income and home ownership meet.

hover a cell → wrongful-rejection rate, default rate, group size
Rent
Own
Mortgage
Q1 low
76.7RENT
72.8OWN
64.9MORTGAGE
Q2
71.1RENT
66.2OWN
59.4MORTGAGE
Q3
68.2RENT
63.0OWN
55.5MORTGAGE
Q4 high
62.8RENT
53.8OWN
47.1MORTGAGE
47%77%rejection rate · validation 2016

A low-income renter is rejected 76.7% of the time against 47.1% for a high-income owner. A single calibrated threshold over groups with different base rates cannot equalize error rates and stay calibrated — the disparity is structural, not a bug.

05

What fairness costs

Fairlearn’s off-the-shelf optimizer broke — it approved almost everyone, turning $65.6M of profit into a nine-figure loss, because it optimizes accuracy, not money.

A custom profit-aware per-group threshold works: every group clears the four-fifths line at a measurable cost. But there is no free lunch — the baseline is both the most profitable and the least fair.

FixProfitCost
Baseline$65.57M
Income tier$61.23M−6.6%
Home ownership$61.33M−6.5%
Income × home$59.84M−8.7%
06

My contribution

01Leakage auditdropped 49 post-decision fields
02Feature engineering79 features from a messy book
03LightGBM + Optunatuned champion, TPE search
04Calibrationisotonic — honest probabilities
05Threshold optimizationprofit-max under a cost basis
06Fairness auditdisparate impact + mitigation
07

Three takeaways

BusinessProfit > accuracyThe two errors cost 5-to-1. Optimizing accuracy leaves money on the table; a profit-aware threshold captures it.
Machine learningCalibration changed deploymentHonest probabilities mean the scores feed pricing and provisioning — not just a ranking.
Responsible AIFairness has measurable costsCompliance is priced at $2.4–5.7M, not asserted. The tradeoff is made explicit, not hidden.