← 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

Customer scoring

Score a portfolio applicant or a new application through the live API, with a risk grade, a decision and SHAP reason codes.

Open full screen ↗

About this page

Scores one customer through the live API, which returns the probability of default, risk grade and decision. The reason codes show which details pushed the risk up or down, which lenders need to explain a decline.

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
Applicant ID and random buttonsPick a portfolio applicant, or a random (defaulting) one.Rescores the applicant and shows the actual outcome.
New application formA hypothetical applicant, scored when you press Score application.Missing fields are imputed. The effects below are from a default applicant with a PD of about 11%.
External scores 1–3Credit bureau scores (0–1). Untick if unavailable.The strongest inputs. Score 3 at 0.80 gives a PD of about 5%, and at 0.20 about 23%.
Annual repaymentYearly instalment.Higher for the same loan raises the PD (45,000: 15%).
Loan amount and goods priceAmount borrowed and the price of what it finances.Borrowing well above the goods price raises the PD (goods price 350,000: 16%).
Years in current jobEmployment tenure.Longer lowers the PD (1 year: 15%, 15 years: 8%).
Education, contract type, region and other profile fieldsApplicant profile.Moderate effects. For example, higher education gives 7%. Income and age on their own move the PD by under 3 points.

What the numbers and charts mean

Shown on the pageWhat it meansHow to read it
Probability of defaultEstimated chance of payment difficulties.Coloured bands mark the grade boundaries.
Risk gradeA (< 2%), B (< 5%), C (< 10%), D (< 20%) or E.Sets pricing and limits.
DecisionApprove below 10% PD, refer at 10–20%, decline at 20% or more.Refer means a person reviews the application.
Riskier thanShare of the portfolio with a lower PD.86% means riskier than 86% of applicants.
Actual outcomeWhether this loan really defaulted.A 10% PD means about 1 in 10 similar applicants default.
Reason codesEach feature's push on the score (SHAP).Red raises risk and green lowers it. Longer bars matter more.
Credit- and repayment-to-incomeLoan ÷ income and repayment ÷ income.Higher means a heavier debt burden.
Scored viaSource of the score.API: live service. In-process: the API was asleep.