← 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

Portfolio overview

Risk-grade mix, PD distribution, expected loss and default rates by segment.

Open full screen ↗

About this page

A risk manager's view of the whole book: how applications spread across risk grades, how much the portfolio is expected to lose, and which segments carry the most risk. Each application's probability of default (PD) sets its grade (A to E) and decision.

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
Loss given default (LGD)Share of a defaulted loan that is lost (0–100%, default 45%).Only expected loss changes, in proportion. PDs, grades and decisions stay the same.
Segment byCustomer attribute used to split the portfolio.Redraws the segment chart and table. Segments under 30 applications are hidden.

What the numbers and charts mean

Shown on the pageWhat it meansHow to read it
ApplicationsNumber of applications scored.Context for the other numbers.
Mean PDAverage predicted default probability.Higher means a riskier book.
Observed default rateShare that actually defaulted.Close to mean PD means well calibrated (simulated outcomes in the demo).
ExposureTotal loan amount.The money at risk.
Expected lossSum of PD × LGD × loan amount, also as a share of exposure.Rises with risk or LGD.
Risk grades chartApplications per grade (bars), with mean PD and observed default rate (lines).Both lines should rise from A to E and stay close together.
PD distributionPDs of loans that defaulted vs loans that did not.Less overlap means better separation.
Segment chart and tablePredicted and observed default rates, and expected loss, by segment.Observed well above predicted means the model under-predicts that segment.
Decision mixApprove (PD < 10%), refer (10–20%) and decline (20% or more).Try other cut-offs on the Strategy Simulator tab.