CREDIT SCORECARD MATHEMATICS — COMPLETE COURSE
Mathematics · Credit Risk · From First Principles

The Complete Math of
Credit Scorecards

From basic statistics to logistic regression, Weight of Evidence, XGBoost, AUC, KS statistic, and scorecard point scaling — everything you need to build, evaluate, and govern credit models in African lending markets. Interactive throughout.

01

Statistical Foundations

Distributions, variance, hypothesis testing — the bedrock every credit model rests on
~25 min

Before any credit model can be built, you need a working grasp of the statistical concepts that underpin it. These are not optional background reading — they determine whether you can correctly interpret model outputs, spot errors in model development, and explain results to a credit committee.

Distributions and the shape of your data

A distribution tells you how often each value appears in your dataset. Two numbers describe most distributions usefully: the mean (average — where the centre is) and the standard deviation (how spread out values are around that centre).

Mean (μ) = (x₁ + x₂ + ... + xₙ) / n Variance = Σ(xᵢ - μ)² / n ← average squared distance from mean Std Dev (σ) = √Variance ← back in original units Example: Monthly incomes of 5 borrowers (KES '000): 18, 24, 35, 42, 81 Mean = (18+24+35+42+81)/5 = 40k Variance = [(18-40)²+(24-40)²+(35-40)²+(42-40)²+(81-40)²]/5 = [484+256+25+4+1681]/5 = 490 Std Dev = √490 ≈ 22.1k
Why this matters in credit

Standard deviation tells you how "typical" your data is. An income std dev of 22k on a mean of 40k means income is highly variable — you cannot rely on the mean alone to represent the population. For thin-file borrowers with irregular informal income, the std dev is even wider, which is why a single income figure is unreliable and models need to use income variability as a feature, not just income level.

Interactive: Income distribution explorerDEMO

Explore how mean and standard deviation shape the income distribution of your loan applicant pool. Toggle between a salaried workforce (low variance) and an informal sector pool (high variance).

35k
10k

Percentiles and the median

The mean is sensitive to extreme values (outliers). The median is the middle value when data is sorted — it is robust to outliers. In credit data, income distributions are right-skewed (a few very high earners pull the mean up), making the median a better "typical borrower" descriptor than the mean.

Key percentiles in credit scoring

25th percentile (Q1): 25% of borrowers earn below this. A borrower at Q1 is in the bottom quarter of your income distribution.

50th percentile (P50/median): The middle borrower. Half earn above, half below.

90th percentile (P90): Only 10% earn above this. Used to set maximum credit limits.

Interquartile range (IQR) = Q3 - Q1: The spread of the middle 50% of borrowers. Used to detect outliers: values below Q1 - 1.5×IQR or above Q3 + 1.5×IQR are typically flagged as outliers.

Correlation: how variables move together

The Pearson correlation coefficient (r) measures the linear relationship between two variables, ranging from -1 (perfect negative relationship) to +1 (perfect positive) with 0 meaning no linear relationship.

r = Σ[(xᵢ - x̄)(yᵢ - ȳ)] / [n × σₓ × σᵧ] Interpretation: r = 0.85 → strong positive correlation (income and loan size) r = -0.62 → moderate negative correlation (loan term and default rate) r = 0.08 → essentially no linear relationship r = -0.95 → very strong negative correlation
Credit application

Before building a scorecard, you compute correlations between all candidate features. Features that are highly correlated with each other (r > 0.8) are multicollinear — including both in a logistic regression will destabilise coefficients. You keep one and drop the other. Features correlated with the target (default) are valuable; features with r ≈ 0 carry no predictive signal and should be dropped.

Interactive: Correlation visualiserDEMO

Adjust the correlation strength between "income" and "repayment probability". Watch how the scatter plot changes and what r means visually.

0.65

Hypothesis testing and p-values

When you test whether a feature is predictive of default, or whether two groups of borrowers have significantly different default rates, you are doing hypothesis testing.

The logic of a p-value

Start with the null hypothesis (H₀): "this feature has no relationship with default." Compute a test statistic, then ask: if the null hypothesis were true, how likely would it be to observe data at least as extreme as what we have? That probability is the p-value.

A p-value < 0.05 means: there is less than a 5% chance of seeing this result if the feature truly had no effect. We reject the null hypothesis and conclude the feature is statistically significant.

Important: statistical significance ≠ practical significance. A feature can be highly statistically significant but contribute almost no lift to model accuracy. Always look at both the p-value and the effect size.

Foundation insight: Standard deviation, correlation, and p-values are not abstract concepts — they are the tools you use to answer "is this feature useful?" and "is this borrower segment genuinely different from that one?" Master them at the intuitive level and the rest of scorecard math becomes much more accessible.

Check your understanding

A data scientist reports that "income" has a correlation of r = 0.11 with default in your dataset (p-value = 0.03, n = 5,000). Should you include income in your scorecard?

Correct. With n=5,000, even a very small correlation can be statistically significant — large samples make the p-value sensitive to tiny effects. r=0.11 means income explains about 1.2% of variance in default (r²=0.012), which is weak. The right tool is Information Value (Module 2), which directly measures a variable's predictive power in a credit scoring context, not just its linear correlation.
02

Weight of Evidence & Information Value

The scorecard-specific transforms — WoE converts variables into a usable form; IV selects which variables to include
~30 min · Scorecard-specific

WoE and IV are the most important concepts you will not find in a general machine learning course. They are specific to credit scorecard development and underpin how variables are transformed before entering a logistic regression, and how you decide which variables are worth including at all.

Weight of Evidence (WoE)

WoE transforms a variable by replacing each bin (category or range) with a number that reflects how much more or less likely borrowers in that bin are to default vs. repay, relative to the overall population.

For each bin of a variable: Distribution of Bads = (Count of Defaulters in bin) / (Total Defaulters) Distribution of Goods = (Count of Repayers in bin) / (Total Repayers) WoE = ln( Distribution of Goods / Distribution of Bads ) Interpretation: WoE > 0 → this bin contains proportionally more Good borrowers → lower risk WoE < 0 → this bin contains proportionally more Bad borrowers → higher risk WoE = 0 → this bin matches the overall population distribution
Worked example: mobile money transaction frequency

Total population: 1,000 borrowers — 800 Good (repaid), 200 Bad (defaulted).

Transactions/monthCountGoodsBads% Goods% BadsWoERisk
0 – 5150906011.25%30.00%ln(0.1125/0.3) = -0.98High risk
6 – 152802107026.25%35.00%ln(0.2625/0.35) = -0.29Above avg
16 – 303202804035.00%20.00%ln(0.35/0.20) = +0.56Below avg
31+2502203027.50%15.00%ln(0.275/0.15) = +0.61Low risk

Once WoE is calculated, the original variable (transaction count) is replaced in the dataset with its WoE value for each observation. A borrower with 22 transactions/month gets the value +0.56 in the model. This transformation ensures the variable has a linear relationship with the log-odds of default, which is exactly what logistic regression requires.

Information Value (IV)

IV tells you how much predictive power a variable has overall — it is the selection criterion for deciding which variables enter the scorecard.

IV = Σ (Distribution of Goods - Distribution of Bads) × WoE For each bin, compute (% Goods - % Bads) × WoE, then sum across all bins. From the table above: Bin 1: (0.1125 - 0.30) × (-0.98) = 0.183 Bin 2: (0.2625 - 0.35) × (-0.29) = 0.025 Bin 3: (0.35 - 0.20) × (+0.56) = 0.084 Bin 4: (0.275 - 0.15) × (+0.61) = 0.076 ────── Total IV = 0.368 ← Strong predictor

IV interpretation scale

  • IV < 0.02: Useless predictor — exclude
  • IV 0.02 – 0.10: Weak predictor — use with caution
  • IV 0.10 – 0.30: Medium predictor — include
  • IV 0.30 – 0.50: Strong predictor — definitely include
  • IV > 0.50: Suspiciously strong — check for data leakage

IV > 0.5 is a red flag. It usually means the variable contains future information (you accidentally used data available after the loan decision) or that it is a proxy for the target variable itself. In an African fintech context: if "number of previous loans repaid" has IV = 0.72, check whether it was computed from the same portfolio — it may be a circular feature.

Interactive: WoE and IV calculatorDEMO

Adjust the distribution of Goods and Bads across bins to see WoE and IV update in real time. Watch how uneven separation between bins drives a higher IV.

WoE bars: positive (blue, low risk) vs negative (red, high risk). Taller bars = more separation from the population average.
Key insight: WoE solves two problems simultaneously. It handles non-linear relationships (a variable might have high default rates at both extremes — WoE captures this in the binning). And it makes the variable's relationship with log-odds linear, which is the mathematical requirement for logistic regression. This is why WoE transformation before logistic regression is standard practice in scorecard development.

Check your understanding

A variable "days since last M-Pesa transaction" has IV = 0.08. What should you do?

Correct. IV thresholds are guidelines, not hard rules. A variable with IV = 0.08 on its own may be worth including if it captures a different dimension of risk than your other variables (e.g. recency vs. frequency vs. monetary value). However, if you already have 8 variables with IV > 0.20, a weak variable adds complexity without much benefit and increases overfitting risk. Always make the decision in context.
03

Logistic Regression

The workhorse of credit scoring — from probability to odds to log-odds to a score
~35 min · Core model

Logistic regression is the foundation of almost every traditional credit scorecard in production. Understanding it mathematically — not just conceptually — is essential for interpreting why a model scores a borrower the way it does, what a coefficient means, and how a model can fail.

From probability to odds to log-odds

Logistic regression predicts default probability. But it does so indirectly — by modelling the log-odds of default. Understanding why requires three steps.

Step 1: Probability P(default) = 0.15 ← direct probability: 15% chance of default Step 2: Odds Odds = P(default) / P(no default) = 0.15 / 0.85 = 0.176 "For every 1 borrower who defaults, 5.7 repay" (1/0.176 ≈ 5.7) Step 3: Log-odds (logit) Log-odds = ln(Odds) = ln(0.176) = -1.74 This is what logistic regression models — it is linear in the features Going back from log-odds to probability: P = 1 / (1 + e^(-log-odds)) = 1 / (1 + e^1.74) = 0.15 ✓

The reason for this transformation: probability is bounded (0 to 1), which makes it awkward to model with a linear equation. Odds are positive but unbounded upward. Log-odds are unbounded in both directions (-∞ to +∞), which means they can be modelled as a linear combination of features — the same structure as linear regression.

Interactive: Probability ↔ Odds ↔ Log-odds converterDEMO

Drag to see how probability, odds, and log-odds relate. Notice how small changes in probability near 0 or 1 produce large changes in log-odds — logistic regression is most sensitive in the middle.

15%

The logistic regression equation

Log-odds = β₀ + β₁x₁ + β₂x₂ + ... + βₙxₙ Where: β₀ = intercept (baseline log-odds when all features are 0) β₁...βₙ = coefficients (each represents the change in log-odds per unit increase in the corresponding feature) x₁...xₙ = feature values (WoE-transformed in a scorecard) For a borrower with 3 features (all WoE-transformed): Income WoE = +0.42 → β₁ = 0.85 → contribution = 0.85 × 0.42 = +0.357 Loan term WoE = -0.18 → β₂ = 0.62 → contribution = 0.62 × -0.18 = -0.112 Transactions WoE= +0.56 → β₃ = 0.71 → contribution = 0.71 × 0.56 = +0.398 Intercept β₀ = -2.1 Log-odds = -2.1 + 0.357 + (-0.112) + 0.398 = -1.457 P(default) = 1 / (1 + e^1.457) = 18.9%

Interpreting coefficients

What a coefficient actually means

A coefficient β represents the change in log-odds for a one-unit increase in that feature (after WoE transformation). To make this interpretable, convert to an odds ratio: e^β.

If β₁ = 0.85 for income WoE: odds ratio = e^0.85 = 2.34. This means a one-unit increase in income WoE multiplies the odds of repayment by 2.34 — borrowers in higher-income bins are 2.34 times more likely to repay vs. default, for each step up in the WoE scale.

Sign: positive coefficient → higher feature value → higher log-odds of the modelled event. In a model predicting default, a positive coefficient on a risk feature means higher values = higher default probability. Make sure you know which outcome (default or repayment) your model is predicting — getting this backwards produces a scorecard where higher scores mean worse borrowers.

How logistic regression is trained: maximum likelihood

Logistic regression finds coefficients that maximise the likelihood of observing the outcomes in the training data. For each borrower, the model assigns a probability; the likelihood is the product of those probabilities across all borrowers. The training algorithm adjusts coefficients to make that product as large as possible.

Log-likelihood (more tractable than likelihood directly): LL = Σ [yᵢ × ln(pᵢ) + (1-yᵢ) × ln(1-pᵢ)] Where yᵢ = 1 if defaulted, 0 if repaid; pᵢ = model's predicted probability For a borrower who repaid (y=0), predicted p=0.12: Contribution = 0×ln(0.12) + 1×ln(0.88) = ln(0.88) = -0.128 For a borrower who defaulted (y=1), predicted p=0.12: Contribution = 1×ln(0.12) + 0×ln(0.88) = ln(0.12) = -2.12 ← large negative contribution: model was wrong and confident
Interactive: Logistic regression decision boundaryDEMO

Adjust the coefficient for income to see how the decision boundary shifts. Blue dots = repaid, red dots = defaulted. The S-curve is the logistic function mapping income to default probability.

-1.5
1.5
Key insight: Logistic regression is transparent — you can see exactly why a borrower was scored a certain way by looking at each feature's WoE value and its coefficient. This explainability is why scorecards built on logistic regression remain preferred by regulators and credit committees in African markets, even as tree-based models often achieve higher accuracy. A model you can explain is a model you can defend.
04

Decision Trees & XGBoost

How tree-based models work, why they outperform logistic regression on messy data, and what XGBoost actually does
~35 min

Decision trees and their ensemble variants (Random Forests, XGBoost) are the dominant models for credit scoring in environments with messy, high-dimensional data — which describes most African fintech contexts. They require less preprocessing than logistic regression (no WoE transformation needed), handle non-linear relationships automatically, and often achieve higher AUC. The tradeoff is interpretability.

How a decision tree works

A decision tree splits the population into increasingly homogeneous groups by asking binary questions. At each node, the algorithm chooses the feature and the threshold that best separates defaulters from repayers.

Gini Impurity — measures how "mixed" a node is: Gini = 1 - Σ pᵢ² Example: A node with 70% repayers and 30% defaulters: Gini = 1 - (0.7² + 0.3²) = 1 - (0.49 + 0.09) = 0.42 A pure node (100% one class): Gini = 1 - (1.0² + 0.0²) = 0.0 ← perfectly pure A maximally mixed node (50% / 50%): Gini = 1 - (0.5² + 0.5²) = 0.5 ← maximum impurity Gini Gain (how much a split improves purity): Gain = Gini(parent) - [w_left × Gini(left) + w_right × Gini(right)] where w = proportion of samples going to each child node
Interactive: Decision tree split finderDEMO

Drag the split threshold across "monthly transaction count". The algorithm chooses the threshold that minimises weighted Gini impurity — producing the cleanest separation between Good and Bad borrowers.

15

From one tree to many: ensemble methods

Why a single tree is not enough

A single deep decision tree overfits — it learns the noise in the training data and performs poorly on new data. It is also highly unstable: small changes in the training data produce very different trees.

Random Forest trains hundreds of trees, each on a random subset of the data and a random subset of features. The final prediction is the average (or vote) of all trees. Averaging reduces variance, producing a more stable and generalisable model.

Boosting is different from averaging. Instead of training trees independently, boosting trains trees sequentially, where each new tree learns to correct the errors of the previous ones.

XGBoost: the dominant algorithm in credit scoring competitions

XGBoost (eXtreme Gradient Boosting) is a highly optimised implementation of gradient-boosted trees. Understanding it requires two concepts: gradient descent and residuals.

Gradient Boosting intuition: Iteration 1: Predict default using a simple model → get predictions p₁ Compute residuals = actual_default - p₁ ← where did we go wrong? Iteration 2: Train tree₂ to predict those residuals → adds correction δ₂ New prediction = p₁ + learning_rate × δ₂ Iteration 3: Compute new residuals, train tree₃ to predict them... ...repeat for N iterations (typically 100–500 trees) Final prediction: p_final = p₁ + η×δ₂ + η×δ₃ + ... + η×δₙ where η = learning rate (typically 0.01 – 0.3)

XGBoost hyperparameters you must understand

  • n_estimators: number of trees. More trees = lower bias but higher risk of overfitting. Tune with cross-validation.
  • learning_rate (η): how much each tree contributes. Lower = slower learning, more trees needed, but often better generalisation.
  • max_depth: maximum depth of each tree. Shallow trees (depth 3–6) are typical for credit data.
  • subsample: fraction of training data to use for each tree. <1.0 introduces randomness, reduces overfitting.
  • scale_pos_weight: addresses class imbalance. Set to (total negatives / total positives) when defaults are rare — typically 5–20× in credit portfolios.
  • reg_alpha, reg_lambda: L1 and L2 regularisation. Penalise large coefficients to prevent overfitting on noisy features.
Interactive: Boosting — watching errors shrinkDEMO

Watch how gradient boosting progressively reduces prediction error. Each iteration adds a small correction to the previous prediction. The learning rate controls how big each correction is.

0.10
20

Logistic regression vs. XGBoost: which to use?

FactorLogistic Regression + WoEXGBoost
InterpretabilityHigh — each feature's contribution is explicitLow — complex interaction effects, requires SHAP values to explain
Regulatory approvalEasier — standard in banking regulation worldwideHarder — "black box" concerns; some regulators require explainability
Data preprocessingRequires WoE transformation, careful binningWorks with raw features, handles non-linearity automatically
Missing dataRequires explicit imputationHandles missing values natively
Small datasetsWorks reasonably with 2,000+ observationsRisk of overfitting with <5,000 observations
AUC performanceTypically 0.68–0.78 on credit dataTypically 0.72–0.85 on same data
Production deploymentSimple — score = linear combinationRequires serialised model file and scoring engine
Practical recommendation for African fintech: Build both. Use logistic regression as your regulatory scorecard (the model you submit to a credit committee, report to a regulator, and use to generate integer point scores). Use XGBoost as your challenger model — evaluate whether it adds meaningful AUC lift. If it does and you need the performance, invest in SHAP-based explainability infrastructure to satisfy governance requirements.
05

AUC & the ROC Curve

The standard measure of a credit model's discriminatory power — and what it actually means
~25 min · Essential metric

AUC is the single most-cited metric in credit model evaluation. But it is frequently misunderstood — used as a quality label ("our model has AUC 0.82") without a clear sense of what that number means or what it cannot tell you. This module builds genuine intuition from first principles.

The ROC curve from scratch

The Receiver Operating Characteristic curve plots the tradeoff between correctly identifying defaults (True Positive Rate) and incorrectly flagging repayers as defaults (False Positive Rate) across every possible decision threshold.

True Positive Rate (TPR / Sensitivity / Recall): TPR = TP / (TP + FN) = "of all actual defaults, what fraction did we catch?" False Positive Rate (FPR / 1 - Specificity): FPR = FP / (FP + TN) = "of all actual repayers, what fraction did we wrongly flag?" At threshold = 0%: decline nobody → TPR=1, FPR=1 (top-right corner) At threshold =100%: decline everyone → TPR=0, FPR=0 (bottom-left corner) ROC curve traces the path between these extremes as threshold changes

What AUC actually means

The concordance interpretation

AUC = the probability that a randomly chosen defaulter receives a higher risk score than a randomly chosen repayer. This is the most concrete way to understand what AUC measures.

AUC = 0.80 means: if you pick one defaulter and one repayer at random from your portfolio, there is an 80% chance your model correctly assigns a higher risk score to the defaulter. The remaining 20% of the time, the model ranks the repayer as riskier.

AUC = 0.50 is no better than random — equivalent to flipping a coin. AUC = 1.0 is a perfect model. Real credit models in developed markets with bureau data typically achieve 0.72–0.82. African thin-file models using alternative data typically achieve 0.65–0.78 depending on data quality.

Interactive: ROC curve builderDEMO

Adjust model quality and see how the ROC curve changes. The orange dot shows your current operating threshold. AUC = shaded area under the curve.

Medium
25%

What AUC cannot tell you

Critical limitations of AUC as a sole metric

  • AUC is threshold-independent. It tells you about discriminatory power across all thresholds, but you operate at one threshold. A model with AUC 0.78 might perform worse than a model with AUC 0.74 at your specific operating threshold.
  • AUC is class-imbalance insensitive. With 5% defaults, a model that slightly separates the two classes can achieve high AUC. Check Precision-Recall AUC for highly imbalanced problems.
  • AUC is population-wide. Good overall AUC hides poor performance on subgroups. Always compute AUC separately for each market, each product, and each demographic segment you care about.
  • AUC does not measure calibration. A model with AUC 0.80 whose predicted probabilities are systematically wrong (it says 30% but true rate is 18%) can still have AUC 0.80. Calibration matters for setting reserves and pricing risk.

Check your understanding

Your model has AUC = 0.80 on a development sample and AUC = 0.74 on an out-of-time validation sample (data from a later period). What does this tell you?

Correct. Some AUC drop from development to out-of-time validation is always expected — no model perfectly generalises. A drop of 0.06 is meaningful but not necessarily disqualifying. The key questions are: (1) Is 0.74 above your minimum acceptable AUC for deployment? (2) What drove the drop — look at which variables degraded most. (3) Is the validation period representative of the future operating environment? A larger drop (e.g. 0.80 → 0.63) would indicate serious overfitting requiring model revision.
06

KS Statistic & Gini Coefficient

The credit-specific discrimination metrics that complement AUC
~20 min · Credit-specific

While AUC is the international standard, credit risk teams in many markets use two additional metrics: the Kolmogorov-Smirnov (KS) statistic and the Gini coefficient. Both measure discrimination but in different ways, and both have specific interpretive conventions in credit scoring that differ from their uses in other fields.

The KS Statistic

The KS statistic measures the maximum separation between the cumulative distributions of Good and Bad scores. Concretely: sort all borrowers by predicted score, then plot the cumulative fraction of Goods and cumulative fraction of Bads. KS is the maximum vertical distance between these two lines.

KS = max[ CDF_Goods(score) - CDF_Bads(score) ] Practical interpretation — at the KS point: This is the score threshold that maximises the separation between Goods and Bads — often used as the "optimal" operating cutoff. KS benchmarks for credit models: KS < 20 → Poor model, not viable KS 20 – 30 → Below average, acceptable for thin-file populations KS 30 – 40 → Good model KS 40 – 50 → Very good model KS > 50 → Excellent (or check for data leakage)
Interactive: KS statistic visualiserDEMO

The KS statistic is the maximum gap between the Good (blue) and Bad (red) cumulative distributions. Adjust model quality to see how it changes.

Medium

The Gini Coefficient (in credit scoring)

The credit scoring Gini is different from the economics Gini. It is directly derived from AUC:

Gini = 2 × AUC - 1 So: AUC = 0.80 → Gini = 0.60 (or 60%) AUC = 0.72 → Gini = 0.44 (or 44%) AUC = 0.50 → Gini = 0.00 (random model) The Gini is also the normalised area between the Lorenz curve and the diagonal of no-discrimination. In credit, it's often reported as a percentage. Gini benchmarks: Gini < 30% → Poor Gini 30–45% → Acceptable Gini 45–60% → Good Gini > 60% → Excellent
Relationship between metrics: AUC, Gini, and KS all measure discrimination but are not interchangeable. AUC and Gini measure average performance across the whole score distribution. KS focuses on the single point of maximum separation. It is possible for Model A to have higher AUC but lower KS than Model B — which is better depends on whether you care about overall ranking quality or performance at a specific cutoff.
07

Scorecard Scaling

Converting a logistic regression into integer points — PDO, master scale, and score banding
~30 min · Applied scorecard

A credit scorecard is not just a logistic regression — it is a logistic regression translated into integer points that credit officers can apply manually, audit easily, and explain to borrowers. This translation step is the most applied and practically important step in traditional scorecard development, and it is almost completely absent from machine learning courses.

The scaling parameters: PDO and base score

Points to Double the Odds (PDO)

PDO is the number of scorecard points that correspond to a doubling of the odds of being a Good borrower. A PDO of 20 means: for every 20 points you move up the scorecard, the odds of repayment double.

Base score is the score assigned to a borrower with the baseline odds (typically the portfolio average odds). Common choices: 600 points at odds of 30:1 (30 Goods for every 1 Bad).

These parameters are business decisions, not statistical ones — they set the scale of the scorecard to a range that is intuitive for credit teams (e.g. 300–850, like the US FICO scale, or 0–1000).

Scaling equations: Factor = PDO / ln(2) Offset = Base_Score - Factor × ln(Base_Odds) Example: PDO = 20, Base Score = 600, Base Odds = 30 Factor = 20 / ln(2) = 20 / 0.6931 = 28.85 Offset = 600 - 28.85 × ln(30) = 600 - 28.85 × 3.401 = 600 - 98.1 = 501.9 Score = Offset + Factor × ln(odds) = Offset - Factor × (β₀ + β₁×WoE₁ + β₂×WoE₂ + ...) This decomposes into a sum of points per variable: Score = Constant + Σ Points_per_variable_bin

From coefficients to integer points

For each variable and each bin: Points(variable i, bin j) = -(β_i × WoE_ij + β₀/n_variables) × Factor + Offset/n_variables Worked example: Income variable, coefficient β₁ = 0.85, Factor = 28.85 Income Bin WoE Raw Points Rounded Points ─────────────────────────────────────────────────────── < KES 15k -0.98 +23.1 23 KES 15k–25k -0.29 +16.1 16 KES 25k–45k +0.42 +7.7 8 KES 45k–70k +0.56 +5.7 6 KES 70k+ +0.61 +5.1 5 Lower income = more points because we're scoring Badness (default risk) Wait — depends on what you're modelling. If scoring Goodness: Higher income = more points = better score = lower default risk.
Interactive: Scorecard point calculatorDEMO

Build a mini scorecard for a borrower by selecting their characteristic values. The total score determines their risk band and maximum loan amount.

Score banding and policy cutoffs

Once borrowers are scored, the score is divided into bands that correspond to risk categories and credit policies. Setting the band boundaries is a business decision informed by the default rate and expected return in each band.

BandScore rangeObserved default rateRecommended policyMax loan (KES)
A720+2–5%Auto-approve50,000
B680–7195–10%Approve with conditions30,000
C640–67910–18%Manual review required15,000
D600–63918–28%Senior approval required5,000
E<60028%+Decline0
Why integer points matter: A scorecard that produces a score of 647 is more useful than one that says "default probability = 0.142" because: (1) credit officers can mentally apply it, (2) it is auditable — you can see exactly which bins contributed which points, (3) regulators can review it, and (4) you can explain to a declined borrower exactly which of their characteristics drove the decision. This explainability is both a regulatory requirement in some markets and an ethical obligation in any market.
08

Model Validation & Monitoring

PSI, characteristic stability, back-testing, and how to know when a model needs retraining
~25 min

A credit model validated once at development and never reviewed again will degrade silently as borrower behaviour, economic conditions, and product mix change. Model monitoring is the operational discipline that catches this degradation before it causes material losses.

Population Stability Index (PSI)

PSI measures whether the score distribution of recent borrowers looks similar to the score distribution of the development sample. If borrowers' scores are shifting, the model is operating on a different population than it was trained on.

PSI = Σ (Actual% - Expected%) × ln(Actual% / Expected%) Where: Expected% = % of development sample in each score band Actual% = % of recent production sample in same score band Example (5 score bands): Band Expected% Actual% Contribution ───────────────────────────────────────── A 15% 12% (0.12-0.15)×ln(0.12/0.15) = +0.0056 B 25% 21% (0.21-0.25)×ln(0.21/0.25) = +0.0071 C 30% 34% (0.34-0.30)×ln(0.34/0.30) = +0.0052 D 20% 24% (0.24-0.20)×ln(0.24/0.20) = +0.0073 E 10% 9% (0.09-0.10)×ln(0.09/0.10) = +0.0010 ──────── PSI 0.0262 PSI = 0.026 → Minor shift, monitoring recommended

PSI thresholds

  • PSI < 0.10: No significant change. Model is stable.
  • PSI 0.10–0.25: Minor shift. Investigate characteristics; consider recalibration.
  • PSI > 0.25: Major shift. Model likely requires redevelopment.

In African markets with high economic volatility, PSI can spike quickly after macro events — a currency crisis, a drought affecting rural borrowers, a mobile money regulatory change. Running PSI monthly (not quarterly) is advisable for products operating in volatile environments.

Characteristic Stability Index (CSI)

PSI measures score stability. CSI measures whether each input variable is stable — have the distributions of income, transaction count, or loan term changed? CSI uses the same formula as PSI but applied to individual variable bins rather than score bands. A high PSI with multiple high CSI values tells you which variables are driving the score shift.

Interactive: PSI monitoring dashboardDEMO

Simulate a portfolio over time. Adjust the economic shock severity to see PSI spike and monitor whether thresholds are breached. This is what a monthly model monitoring dashboard looks like.

Month 6
Moderate

Back-testing: did the model actually predict outcomes?

Back-testing compares the model's predicted default rates at deployment time with the actual default rates observed after the loan matures. If the model predicted 12% defaults in Band C and actual defaults were 11.8%, the model is well-calibrated. If actual defaults were 22%, the model was systematically overoptimistic.

Calibration test per score band: Expected default rate: p_expected (from model at origination) Actual default rate: p_actual (observed after loan maturity) Calibration ratio = p_actual / p_expected Ratio ≈ 1.0 → well calibrated Ratio > 1.5 → model is optimistic — actual risk is higher than predicted Ratio < 0.7 → model is pessimistic — declining creditworthy borrowers Hosmer-Lemeshow test: formal statistical test of overall calibration p-value > 0.05 → cannot reject good calibration (acceptable) p-value < 0.05 → evidence of poor calibration (investigate)

When to retrain vs. recalibrate vs. rebuild

SignalLikely causeAction
PSI 0.10–0.25, AUC stableGradual population driftRecalibrate intercept / score bands
PSI > 0.25, AUC droppingSignificant population changeRetrain on recent data
AUC drop >0.05 on out-of-timeConcept drift or new risk segmentRetrain + review feature set
Calibration ratio >1.5 in a bandSystematic mispricing of riskAdjust cutoffs immediately; retrain
New product/channel/marketOut-of-distribution deploymentRebuild with relevant training data
Final insight: Model validation is not a one-time event performed before launch — it is an ongoing operational discipline. For a credit model in an African market, plan for quarterly AUC and PSI review as a minimum, monthly in volatile conditions, and a formal annual model review with complete back-testing. The cost of a degraded model (bad debt from approving too much risk, or revenue loss from declining too many creditworthy borrowers) almost always exceeds the cost of the monitoring infrastructure.

Final check

Your credit model has been in production for 14 months. PSI = 0.31. AUC on the last 3 months of data = 0.69 (vs. 0.78 at launch). Calibration ratio in Band C = 1.7. What do you do?

Correct. You have three simultaneous red flags: PSI > 0.25 (major population shift), AUC drop of 9pp (material discrimination loss), and calibration ratio 1.7 in a single band (you're approving borrowers at significantly higher risk than the model predicted). Each alone would warrant action; together they indicate the model is no longer fit for purpose. Immediately tighten Band C to reduce incoming risk exposure, brief the credit committee, and begin model rebuild targeting completion in 60–90 days.

Complete concept reference

Mean / Std Dev
Centre and spread of a distribution. High std dev = high variance = unreliable single-point estimates.
Correlation (r)
Linear relationship between two variables, -1 to +1. Used for feature selection and multicollinearity detection.
P-value
Probability of observing this data if null hypothesis were true. <0.05 = reject null. Does not measure effect size.
WoE
ln(% Goods / % Bads) per bin. Positive = lower risk. Transforms variable to have linear relationship with log-odds.
IV
Sum of (% Goods - % Bads) × WoE across all bins. <0.02 useless, >0.30 strong, >0.50 suspicious.
Odds / Log-odds
Odds = P/(1-P). Log-odds = ln(odds). Unbounded, linear in features — what logistic regression actually models.
Logistic Regression
Models log-odds as a linear combination of features. Transparent, regulator-friendly, requires WoE preprocessing.
Gini Impurity
Measures how mixed a tree node is. 0 = pure, 0.5 = maximally mixed. Split criterion for decision trees.
XGBoost
Gradient-boosted trees. Each tree corrects residuals of previous. Higher AUC than logistic regression; less interpretable.
AUC
P(score(defaulter) > score(repayer)) for random pair. 0.5 = random, 1.0 = perfect. Benchmark: 0.70–0.82 for credit.
KS Statistic
Max separation between cumulative Good and Bad distributions. >40 = good model. Points to optimal operating threshold.
Gini (credit)
2×AUC - 1. Same information as AUC expressed differently. 0% = random, 60% = excellent.
PDO
Points to Double the Odds. Scorecard scaling parameter. 20 PDO means 20 points higher = 2× better repayment odds.
Score Bands
Ranges of integer scores mapped to risk categories and credit policies. A/B/C/D/E or similar banding.
PSI
Population Stability Index — measures score distribution shift vs. development. >0.25 = rebuild required.
Calibration
Whether predicted probabilities match observed outcomes. Calibration ratio = actual% / predicted%. Target: near 1.0.