← All projects
Completed Personal Project Nov 2026

Credit Risk ML Platform

Predicts the probability that a consumer loan defaults, then turns it into decisions: risk grades, approval cut-offs, collections priorities and drift alerts. The model, API and dashboard below are live.

Test AUC
0.769
Gini
0.537
Lift in the riskiest 10%
3.5x
Loans modelled
307,511
PythonLightGBMscikit-learnSHAPMLflowFastAPIStreamlitDockerGitHub Actions

Strategy simulator

Approval cut-off trade-offs between growth, bad rate and profit, and risk-based collections prioritisation.

Open full screen ↗

About this page

Turns scores into decisions. Approval strategy trades growth against risk and profit as the cut-off moves. A loan earns margin × term × amount if it performs and loses LGD × amount if it defaults. Collections prioritisation shows the gain from working the riskiest loans first.

Live demo on free hosting: after a quiet spell the dashboard and API take up to a minute to wake up (choose “Yes, get this app back up” if asked). It scores 5,000 simulated applications, because the Home Credit data can't be redistributed; the model does somewhat less well on them (AUC about 0.70) than on the real data (0.769). Amounts are in the lender's undisclosed local currency.

Controls and what they change

ControlWhat it doesWhat changes when you use it
Approve if PD belowApproval cut-off (1–50%, default 10%).Higher: more approvals, higher bad rate and loss. Profit peaks at the best cut-off.
Loss given default (LGD)Share lost on a default (5–100%, default 45%).Higher: more loss, less profit, stricter optimal cut-off.
Net interest marginYearly income on performing loans (0–40%, default 12%).Higher: more profit, more lenient optimal cut-off.
Term (years)Years the margin is earned (0.5–5, default 1).Works like the margin.
Collections capacityShare of the book the team can work (1–50%, default 20%).More capacity: higher capture, lower lift.

What the numbers and charts mean

Shown on the pageWhat it meansHow to read it
Approval rateShare of applications approved.The growth side of the trade-off.
Bad rate (approved)Default rate among approved loans, vs approving everyone.Negative change means risk is being filtered out.
Defaults avoidedShare of all defaulters declined.Higher means fewer losses.
Expected lossSum of PD × LGD × amount over approved loans.Rises with the cut-off and LGD.
Realised profitProfit from actual outcomes, vs approving everyone.Positive means the cut-off beats lending to all.
Profit by cut-offExpected and realised profit at every cut-off.Green line: maximum profit. Close curves mean PDs are reliable.
Strategy curveApproval rate vs bad rate for every cut-off.A steep end means the last approvals are much riskier.
Break-even PDmargin × term ÷ (margin × term + LGD).Loans above it lose money on average.
Default capture and random captureShare of defaults among the loans worked, vs a random pick.The gap is the value of the model.
Prioritisation liftCapture ÷ random capture.2x means twice as many defaults found.
Cumulative gains chartDefaults captured as more loans are worked.Closer to perfect foresight is better. Capture is not prevention.