Lesson 6.2: Turn a model into score points
Scale a logistic model into points: choose base score, base odds and points to double the odds, build the points table, map scores to PD and give reason codes.
By the end of this lesson you will be able to turn the logistic regression of Lesson 6.1 into a scorecard in the traditional sense: a table in which each bin of each characteristic carries a number of points and the points add up to a score. You will choose the three numbers that fix the scale, the base score, the base odds and the points to double the odds, compute the factor and offset that follow, calculate the points for every bin, convert a score back into a probability of default, check how the scores line up with observed bad rates and produce the reasons that explain a borrower's score. You should have read Lesson 6.1, since the points come directly from its coefficients and the weights of evidence of Module 5. The arithmetic is multiplication, addition and a few logarithms, and all of it is shown.
A logistic model gives a probability, and a probability is exact but awkward to work with. Credit officers prefer a score: a whole number that is bigger for better borrowers, in a range they know, with a table that shows what each answer on the application is worth. A score is easy to explain to a customer ("your utilisation cost you 17 points"), easy to apply in a branch or an app and easy to set cut-offs on ("approve at 560 and above"). The scorecard is the same model in a more convenient form.
The idea: a score is log odds on a new scale
A score is a straight-line rescaling of the log odds of good. Any such rescaling is fixed by two choices: where the line starts and how steep it is. By convention, lenders fix them by naming:
1. A base score: a convenient score, such as 600.
2. The base odds: the odds of good to bad that correspond to the base score, such as 30 to 1.
3. Points to double the odds (PDO): the number of points by which the score must rise for the odds of good to double, such as 20.
These three are chosen by the lender and are arbitrary, but they should be fixed once and kept, so that a given score means the same risk over many years and across scorecards. In this lesson the choice is a base score of 600 at odds of 30 to 1 with a PDO of 20.
From the three choices, two numbers follow.
> Factor = PDO ÷ ln(2) = 20 ÷ 0.6931 = 28.854
>
> Offset = Base score − Factor × ln(Base odds) = 600 − 28.854 × ln(30) = 600 − 28.854 × 3.4012 = 501.86
The score is then:
> Score = Offset + Factor × ln(odds of good)
Check it. At odds of 30, the score is 501.86 + 28.854 × 3.4012 = 600, as designed. At odds of 60, the score is 501.86 + 28.854 × ln(60) = 501.86 + 28.854 × 4.0943 = 620, which is 20 points higher, so doubling the odds from 30 to 60 added the PDO of 20. And at odds of 15 the score is 580. Each 20 points up or down doubles or halves the odds of good to bad.
With the defaults, a score of 533 gives odds of 30 × 2^((533 − 600) ÷ 20) = 30 × 2^(−3.35) = 2.94, which is a PD of 1 ÷ 3.94 = 25.4 per cent. That is close to the 24.9 per cent found directly from the model in Lesson 6.1, and the small difference comes from rounding the points to whole numbers.
From coefficients to points
Each bin of each characteristic gets a number of points. Start from the model of Lesson 6.1:
> ln(odds of good) = β₀ + β₁ WoE₁ + … + β₅ WoE₅
Substituting into the score formula:
> Score = Offset + Factor × β₀ + Factor × β₁ WoE₁ + … + Factor × β₅ WoE₅
Each characteristic contributes Factor × β × WoE points. The intercept term, Offset + Factor × β₀, is shared between the characteristics so that every bin has a positive number of points. With five characteristics, each takes one-fifth of it:
> Points for a bin = Factor × β × WoE + (Offset + Factor × β₀) ÷ 5
The shared term is 501.86 + 28.854 × 2.218 = 501.86 + 64.00 = 565.9, and one-fifth of it is 113.2.
Here is the calculation for the safest utilisation bin (0 to 20 per cent), where β is 0.532 and WoE is +0.860:
Factor × β × WoE = 28.854 × 0.532 × 0.860 = 13.2
Add the shared share 113.2: 13.2 + 113.2 = 126.4, rounded to 126 points.
And for the riskiest utilisation bin (80 per cent and above), with WoE −0.681: 28.854 × 0.532 × (−0.681) = −10.5, and −10.5 + 113.2 = 102.7, rounded to 103 points.
Doing this for every bin gives the scorecard.
Characteristic · Bin · PointsCredit utilisation · 0 to 20% · 126
· 20 to 40% · 122
· 40 to 60% · 115
· 60 to 80% · 109
· 80% and above · 103
Credit enquiries, last 6 months · Fewest (lowest quarter) · 132
· Second · 124
· Third · 109
· Most (highest quarter) · 100
Home · Owned · 125
· Rented or with family · 107
Monthly income · Lowest band · 104
· Second · 110
· Third · 118
· Highest · 123
Credit history · Long · 123
· Short · 98
The total ranges from the sum of the lowest points in each characteristic, 103 + 100 + 107 + 104 + 98 = 512, to the sum of the highest, 126 + 132 + 125 + 123 + 123 = 629.
Notice something instructive: the characteristic with the largest range of points is not the one with the most bins. The range depends on the coefficient and the spread of the weights of evidence. Credit history has only two bins, and its 25-point gap is bigger than the 23 points across the five bins of utilisation, because the coefficient of 0.987 is almost twice as large and its WoE gap (0.906) is wide.
Predict first: an applicant has the following answers: utilisation 60 to 80 per cent, enquiries in the third band, rented, income in the second band and a short credit history. What is the score, and what does the scorecard say about where the applicant is likely to lose the most points? Add up the points before reading on.
The points are 109 + 109 + 107 + 110 + 98 = 533. Compared with the best bin of each characteristic, this applicant loses 17 points on utilisation (126 − 109), 23 on enquiries (132 − 109), 18 on home (125 − 107), 13 on income (123 − 110) and 25 on history (123 − 98). The biggest loss is the short credit history.
From score to probability
The formula that converts a score into a probability is the reverse of the scaling:
> Odds of good = 30 × 2^((Score − 600) ÷ 20), and PD = 1 ÷ (1 + odds)
This gives the score-to-PD table for the scale of this lesson.
Score · Odds of good to bad · Probability of default500 · 0.94 · 51.6%
540 · 3.75 · 21.1%
580 · 15 · 6.3%
600 · 30 · 3.2%
620 · 60 · 1.6%
660 · 240 · 0.4%
Every 20 points halves the probability roughly when the PD is small: 6.3 per cent at 580, 3.2 per cent at 600 and 1.6 per cent at 620. At the risky end, the relationship is flatter, since a PD cannot exceed 100 per cent.
A table like this lets managers think in a common language: a score of 580 means "about one bad in sixteen", and a score of 620 means "about one in sixty".
Does the scale match reality?
The scale is a prediction. To check it, group the 10,000 loans by score band and compare the observed bad rate in each band with the PD that the formula implies at the middle of the band.
Score band · Loans · Observed bad rate · PD from the formula at the band midpoint500 to 540 · 967 · 31.9% · 34.8%
540 to 580 · 4,659 · 10.5% · 11.8%
580 to 620 · 4,067 · 4.8% · 3.2%
620 and above · 307 · 2.0% · 0.8%
The bands add to 10,000 loans, and the overall bad rate is about 10 per cent. The ordering is right: the observed bad rate falls steadily as the score rises, from 31.9 per cent to 2.0 per cent. The magnitudes are close in the middle bands (10.5 against 11.8, and 31.9 against 34.8), and less so at the top, where the scorecard predicts 0.8 per cent against 2.0 per cent observed. The top band has only 307 loans, with about six bad loans, so the observed rate is noisy, and the model's log-odds relation tends to be most uncertain in the tails. A calibration check like this is a core part of validation (Module 7), and where the gaps are systematic, lenders adjust the scale or calibrate the scores to a different level of default, such as the lender's through-the-cycle average.
Reason codes
When a lender declines or prices up an applicant, it must be able to say why. In many markets this is a regulatory expectation, and it is good practice anywhere. The scorecard makes it easy. A reason code names a characteristic where the applicant lost the most points compared with the best possible bin.
For the applicant with a score of 533, the shortfalls are:
Characteristic · Applicant's points · Best bin · Points lostCredit history · 98 · 123 · 25
Credit enquiries · 109 · 132 · 23
Home · 107 · 125 · 18
Utilisation · 109 · 126 · 17
Income · 110 · 123 · 13
The top three reasons are: short credit history, a high number of recent enquiries and not owning a home. Lenders usually report the top two to four reasons in plain words: "length of credit history is short", "number of recent credit enquiries is high". Take care that the reasons are things the applicant can understand, and that they do not reveal the full scorecard. It is also worth checking that no reason is a characteristic that the lender should not be using, which is a good reason to review each characteristic at the design stage.
A subtle point: a reason code tells the applicant what lowered the score relative to the best case, and not necessarily what they could change most easily. A short credit history cannot be fixed quickly, while reducing utilisation can. Some lenders therefore present "actionable" reasons first.
Choosing the scale
Why 600, 30 to 1 and 20? There is no law of nature behind them. The aims are practical.
A range that people recognise. Many credit scores run in the hundreds, such as 300 to 900, so that a score looks like a score.
Room on both sides. The base score is set so that typical borrowers fall in the middle, with room for better and worse scores.
Odds that fit the portfolio. The base odds should resemble the odds of the book. Setting 30 to 1 at 600 puts the average borrower, with odds of 9 to 1, at 600 + 20 × log₂(9 ÷ 30) = 600 − 34.7 = about 565. The average is below the base score, which is fine.
A PDO that is neither too fine nor too coarse. With a PDO of 20, a one-point change in the score changes the odds by about 3.5 per cent (since 2^(1/20) = 1.035). A PDO of 50 would make the score move more slowly, so that the same range of risk would span a narrower range of points, and fewer distinct score values.
Consistency over time. Once a lender sets the scale, it should keep it across rebuilds of the scorecard, so that a score of 600 always means odds of about 30 to 1.
Different lenders choose different scales, and this means that scores from different lenders or bureaus cannot be compared directly unless the scales are known.
A worked example: re-scaling to a different PDO
A lender wants a scale with a PDO of 40 instead of 20, so that the same range of risk covers fewer points. Keep the base score of 600 and the base odds of 30.
Factor = 40 ÷ 0.6931 = 57.71.
Offset = 600 − 57.71 × ln(30) = 600 − 57.71 × 3.4012 = 600 − 196.3 = 403.7.
The applicant's log odds of good from Lesson 6.1 are 1.104. Under the new scale, the applicant's score is 403.7 + 57.71 × 1.104 = 403.7 + 63.7 = 467. Under the original scale it was 501.86 + 28.854 × 1.104 = 501.86 + 31.9 = 533.7, the 533 found by adding the points. The ranking of applicants is the same under both scales, because both are straight-line transformations of the same log odds. Only the numbers change. At 467, the odds are 30 × 2^((467 − 600) ÷ 40) = 30 × 2^(−3.325) = 30 × 0.0998 = 2.99, matching the 3.02 from the model (the small difference is rounding).
The lesson is that the scale is a presentation choice: it changes no decision, since the cut-off moves with it, but it does affect how people talk about the model and how much of it fits in a table.
Building the points table in Python
The calculation applies the formulas of this lesson to the bin table of Lesson 5.2 and the coefficients of Lesson 6.1.
python
import numpy as np
import pandas as pd
basescore, baseodds, pdo = 600, 30, 20
factor = pdo / np.log(2)
offset = basescore - factor np.log(baseodds)
intercept = 2.218
betas = {"utilisation": 0.532, "enquiries": 0.696, "home": 0.955, "income": 0.967, "history": 0.987}
# woetables: dict of DataFrames with columns "bin" and "woe"
n = len(betas)
rows = []
for name, beta in betas.items():
t = woetables[name].copy()
t["points"] = (factor beta t["woe"] + (offset + factor intercept) / n).round().astype(int)
t["characteristic"] = name
rows.append(t)
scorecard = pd.concat(rows)
print(scorecard[["characteristic", "bin", "points"]])
def score(applicantbins):
return sum(scorecard[(scorecard.characteristic == c) & (scorecard.bin == b)]["points"].iloc[0]
for c, b in applicantbins.items())
def pdfromscore(s):
return 1 / (1 + baseodds 2 ((s - basescore) / pdo))
Two checks belong in every build: that the points of the best and the worst bins give the expected range of scores, and that the score of every loan in the development sample, converted to a PD, averages close to the overall bad rate.
Common mistakes
Changing the scale between versions. Keep the base score, base odds and PDO fixed, or scores lose their meaning.
Forgetting that the intercept must be shared. Without it, the points will not add to the right total.
Rounding too early. Round the points at the end. Rounding the coefficients first distorts the score.
Confusing the direction. Be sure whether a higher score means safer, as it does here.
Treating a score band's observed bad rate as exact. Thin bands are noisy.
Giving unhelpful reason codes. Name the characteristic in plain language, and check that it is appropriate to use.
Comparing scores across scales. A 600 on one scale is not a 600 on another.
Not testing calibration. Compare the formula's PD with observed rates by band.
Key takeaways
A score is the log odds of good on a new, more convenient scale, fixed by a base score, base odds and points to double the odds.
Factor = PDO ÷ ln 2 and Offset = base score − factor × ln(base odds). With 600, 30 to 1 and 20, the factor is 28.854 and the offset is 501.86.
Points for a bin are Factor × β × WoE plus an equal share of Offset + Factor × β₀.
In the example the scorecard runs from 512 to 629, and the applicant with answers worth 533 points has a PD of about 25 per cent.
A score maps back to PD by PD = 1 ÷ (1 + 30 × 2^((score − 600) ÷ 20)). Each 20 points halves the PD when PD is small.
Reason codes name the characteristics where the applicant lost the most points against the best bin.
The scale is a presentation choice. A different PDO changes the numbers but not the ranking.
Check yourself
1. With a base score of 500 at odds of 10 to 1 and a PDO of 25, what score corresponds to odds of 20 to 1?
Doubling the odds adds the PDO, so 525.
2. Compute the factor for a PDO of 30.
30 ÷ ln 2 = 30 ÷ 0.6931 = 43.3.
3. A scorecard has five characteristics, a factor of 28.854, β of 0.7 and a WoE of +0.5 for a bin. The shared intercept term is 565.9. What are the points?
28.854 × 0.7 × 0.5 = 10.1, plus 565.9 ÷ 5 = 113.2, which gives 123.3, so 123 points.
4. Odds of good are 15 to 1 at a score of 580 on this scale. What are the odds at 600 and at 560?
At 600 the odds double to 30. At 560 they halve to 7.5.
5. An applicant lost 25, 23 and 18 points on three characteristics. How would you use this?
Report those three characteristics, in plain words, as the main reasons the score is below the best case, after checking that each is appropriate and understandable.
Try this
Build a scorecard from a model and read it. Set aside forty to fifty minutes.
1. Take a logistic model with an intercept, three or more WoE inputs and coefficients, either from Lesson 6.1 or your own.
2. Choose a base score, base odds and PDO. Compute the factor and the offset, writing the arithmetic.
3. Compute the points for every bin using the formula, sharing the intercept term equally. Present them in a table.
4. Find the lowest and highest possible scores. Compute the score of three invented applicants, one good, one average and one poor.
5. Use the simulator to convert each score into a probability of default. Compare your applicants' PDs with the model's direct PDs and explain any small difference.
6. For the poor applicant, compute the points lost against the best bin on each characteristic, and write the top three reason codes in plain words.
7. Change the PDO from 20 to 40, recompute the factor, the offset and the three scores, and check that the ranking of applicants is unchanged. Write a four-sentence note explaining why a lender fixes the scale and keeps it.
A good result is a points table whose arithmetic you can show, a score-to-PD mapping, reason codes in plain words and a demonstration that the scale does not alter the ranking. Lesson 6.3 asks whether a more flexible machine learning model could improve on this scorecard, and at what cost.
Tags: Credit Risk Analytics Scorecard Score Scaling Points to Double the Odds Reason Codes