HomeAI & Machine LearningCredit Scoring Model — Scorecard Builder Live

💳 Credit Scoring Model — Scorecard Builder Live

Build a credit scorecard from synthetic applicant features and watch approval rate, default rate and profit shift together as you drag the score cutoff.

AI & Machine Learning3DAdvanced60 FPS
ai-banking-credit-scoring ↗ Open standalone

About the Credit Scoring Model — Scorecard Builder

Banks and lenders rarely hand a loan officer a raw probability like "14.3% chance of default" — they hand over a score. A credit scorecard takes the log-odds output of a trained classifier and rescales it onto a simple, interpretable integer scale (commonly 300–850), using a fixed offset and factor derived from a "points to double the odds" (PDO) convention. Because the rescaling is a straight affine transform of the log-odds, none of the model's discriminating power is lost — but the score becomes decomposable: every applicant's total can be broken into points contributed by each underlying feature, which is exactly what regulators and credit-risk teams expect to be able to audit.

This simulation generates a synthetic population of several hundred loan applicants with four real underlying features — annual income, debt-to-income (DTI) ratio, a payment-history score, and revolving credit utilisation — trains a genuine logistic regression on those features by gradient descent on cross-entropy loss, and then converts the trained weights into a real points-based scorecard using PDO scaling. Dragging the score cutoff slider changes who gets approved, and the approval rate, default rate among approvals, and expected portfolio profit all update together from the very same threshold sweep over the same underlying population — because all three numbers are computed from the same sorted list of scores, they cannot move independently of one another.

Frequently Asked Questions

What is a credit scorecard, and how is it different from just using a raw probability?

A scorecard takes the log-odds output of a trained logistic regression — a quantity that is hard for a loan officer to reason about intuitively — and rescales it onto a simple integer scale, typically 300–850, using two constants called the offset and the factor. Because the rescaling is a straight affine transform of the log-odds, it preserves all of the model's discriminating power exactly; nothing is lost. What is gained is interpretability and additivity: the transform lets the total score be decomposed into points contributed by each input feature, so a bank can literally hand an applicant a printed breakdown showing how many points came from income, debt-to-income ratio, payment history and utilisation, which a raw probability cannot do.

How are the points for income, DTI ratio, payment history and utilisation actually computed in this simulation?

The simulation first trains a real logistic regression by gradient descent on cross-entropy loss over the synthetic applicant population, producing a weight for each of the four standardised features plus a bias term. Points to Double the Odds (PDO) scaling then converts that weight vector into a factor and an offset: factor = PDO / ln(2), and offset is chosen so a reference odds ratio (50 good accounts per 1 bad account) lands on a target score. Each feature's point contribution for a given applicant is −factor × weight × (standardised feature value), and the bias term becomes a fixed base-points contribution — so the four displayed feature points plus the base points always sum exactly to the applicant's total score.

Why do approval rate, default rate and profit all move together when I drag the cutoff, instead of independently?

All three numbers are computed from the same sorted list of applicant scores and the same fixed population of good/bad outcomes — only the cutoff changes which applicants fall on the approved side of the line. Raising the cutoff always shrinks the approved set (lower approval rate) and always removes the lowest-scoring, highest-risk applicants first (lower default rate among the survivors), because scores are monotonic in modelled risk. Profit is the sum of realised margin on approved goods minus realised loss on approved bads over that same shrinking set, so it necessarily traces out a single curve driven by exactly the same threshold sweep — there is no way for the three curves to disagree about which applicants are "in" at a given cutoff.

What is PDO (points to double the odds) and why 20 points here?

PDO defines how many score points correspond to a doubling of the good:bad odds ratio — for example, if PDO = 20 and a score of 600 corresponds to 50:1 odds, then a score of 620 corresponds to 100:1 odds and a score of 580 corresponds to 25:1 odds. Twenty points per doubling is a long-standing industry convention (used by FICO-style bureau scores) because it produces a scale that spreads scores widely enough to be visually and operationally meaningful across a 300–850 range, without being so steep that small model changes swing scores wildly or so flat that the scale loses discrimination.

Why might the profit-maximising cutoff be different from the cutoff that minimises the default rate?

A cutoff of 850 (approve almost nobody) drives the default rate among approvals toward zero, but it also rejects thousands of pounds of profitable good accounts, so total profit is low. As the cutoff falls, more marginal-but-still-profitable good accounts get approved, each adding positive expected margin, and profit keeps rising even though the default rate among approvals is creeping up — because losing money on a few extra bad accounts is outweighed by the interest earned on many more good ones. Past some point the marginal accounts being let in are bad often enough that their expected losses exceed the margin earned on the marginal goods, and profit turns down even though the default rate keeps climbing. The profit-maximising cutoff sits at the point where marginal expected margin equals marginal expected loss — a genuinely different criterion from minimising the raw default rate.

How is the "true" default label generated in this simulation, and how does that compare with how a real bank gets its labels?

Each synthetic applicant's true default outcome is drawn as a Bernoulli trial from a ground-truth logistic function of income, DTI ratio, payment history and utilisation, plus independent random noise — so the population has a genuinely knowable, if hidden, risk relationship that the trained scorecard is trying to recover. Real banks instead observe defaults only among accounts that were actually approved and funded; applicants who were rejected never generate a repayment outcome at all. That gap is called reject inference, and it means production scorecards are always trained on a selectively observed sample, never the full applicant population the way this simulation's ground truth is generated.

What is adverse selection, and why isn't it modelled directly in this simulation?

Adverse selection describes how the mix of applicants who actually accept a loan offer can shift with price and cutoff — for instance, if a lender raises its interest rate to protect margin at a given cutoff, safer applicants with better outside options may walk away while riskier applicants with fewer alternatives still accept, quietly raising the true default rate of whoever remains. This simulation holds the applicant population fixed and only changes who is approved, which isolates the scorecard mechanics (points, cutoff, approval/default/profit trade-offs) cleanly, but it deliberately does not model applicants declining an offer — a real portfolio manager has to reason about both effects at once, and conflating them would make the core scorecard lesson harder to see.

Why does raising the model-quality control change the shape of the curves rather than just shifting them?

The model-quality control scales how strongly the four features actually separate good and bad applicants in the ground-truth generator, before any training happens. A higher-quality population has less overlap between the good and bad score distributions, so the same trained scorecard achieves a lower default rate at any given approval rate — the whole profit curve lifts and its peak becomes sharper and more forgiving, because there is more genuine signal for the logistic regression to exploit. A lower-quality population squeezes the good and bad distributions together, so no cutoff can cleanly separate them and every point on the approval/default/profit trade-off gets worse simultaneously — this mirrors how, in practice, richer or cleaner applicant data produces a materially better scorecard, not just a relabelled one.

⚙ Under the hood

A real logistic regression is trained with gradient descent on cross-entropy loss over four standardised applicant features, then rescaled into a points-based scorecard with PDO scaling; per-feature points, the score distribution, and a threshold-swept approval/default/profit curve are all rendered as canvas-texture charts and recomputed live as the cutoff slider moves.

Canvas 2DLogistic RegressionScorecardGradient DescentThreshold Sweep

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)