← 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

Model performance

Discrimination, calibration, rank ordering, a confusion matrix at any cut-off and global SHAP importance.

Open full screen ↗

About this page

How well the model ranks risk, and whether its probabilities can be trusted. The headline metrics, ROC, calibration and deciles come from the real 61,503-loan test set. The confusion matrix and SHAP chart use the portfolio shown (synthetic in the demo).

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
Flag as high risk if PD ≥Cut-off for a high-risk flag (2–50%, default 10%).Lower: more loans flagged, recall up, precision down. Higher: the opposite.
Model registryModel versions from MLflow.Not available on the public site.

What the numbers and charts mean

Shown on the pageWhat it meansHow to read it
ROC AUC, Gini, KSRanking power.Higher is better.
PR AUCPrecision–recall area, suited to rare events.A random model scores about 0.08.
Brier score and log-lossPrediction error.Lower is better.
Mean PD vs observedAverage predicted vs actual default rate.Close values mean calibrated.
Recall and lift at top 10%Share of defaults among the riskiest 10%, and the multiple over random.35.5% and 3.55x.
ROC curveDefaulters caught vs good customers flagged, at every cut-off.Further above the diagonal is better.
Calibration chartPredicted vs observed default rate in ten bands.On the diagonal means PDs are accurate.
DecilesLoans in ten equal groups by PD (1 = riskiest).Default rate should fall steadily from 1 to 10.
Confusion matrixGood loans passed or flagged, defaults missed or caught.Moving the cut-off shifts loans between columns.
Recall, precision, share flaggedDefaulters flagged, flagged who default, and loans flagged.Accuracy is omitted: approving everyone is 92% 'accurate'.
Global SHAP importanceAverage influence of each feature.Longer bars matter more. Colour shows the usual direction.
Validation vs testMetrics on the tuning data vs untouched data.Similar values mean no over-fitting.