Articles

How do you calculate weight of evidence and information value?

Two columns of counts, one logarithm per bin and a column total. The binning decides more of the answer than the formula does.

Weight of evidence for a bin is the natural logarithm of the bin's share of all goods divided by its share of all bads. Information value is the sum, over the bins, of the difference between those two shares multiplied by the weight of evidence. On 6,000 SME loan applications with 379 bads, five bins of debt service cover give weights from −0.5656 to 0.9352 and an information value of 0.2002: a medium-strength characteristic, worth keeping.

Worked in full in Machine Learning for Finance by Julian R. Sterling, with every figure reproduced in a free workbook.See the book on Amazon →

The assumptions

The sample is the development cohort of the SME lending case in Machine Learning for Finance: 6,000 applications from 2015 to 2019, of which 5,621 performed and 379 went bad, a bad rate of 6.32 per cent. The characteristic is debt service cover, cut into five bins. Every figure below comes from those counts and nothing else.

Debt service cover, development sample
BinGoodsBadsApplicationsBad rate
Below 1.0089310699910.61%
1.00 to 1.241,007971,1048.79%
1.25 to 1.491,204731,2775.72%
1.50 to 1.991,988892,0774.29%
2.00 and above529145432.58%
Total5,6213796,0006.32%

Step 1: the two distributions

Weight of evidence does not compare bad rates. It compares two distributions: where the goods sit across the bins, and where the bads sit. Divide each bin's goods by all 5,621 goods, and each bin's bads by all 379 bads. Both columns add to 100 per cent.

The lowest bin holds 893 / 5,621 = 15.89 per cent of the goods and 106 / 379 = 27.97 per cent of the bads. It holds proportionally more bads than goods, so it is evidence against the applicant.

Step 2: weight of evidence, bin by bin

WoE = ln(share of goods / share of bads)

Lowest bin: ln(0.1589 / 0.2797) = ln(0.5680) = −0.5656

Highest bin: ln(0.0941 / 0.0369) = ln(2.5477) = 0.9352

Excel, goods in C, bads in D: =LN((C10/SUM($C$10:$C$14))/(D10/SUM($D$10:$D$14)))

A positive weight means the bin is richer in goods than the sample as a whole; zero means it carries no information; negative means it is richer in bads. Some teams write the ratio the other way up, bads over goods. The weights then change sign and the information value does not.

Step 3: information value

Each bin contributes the difference between its two shares multiplied by its weight. Because the difference and the logarithm always have the same sign, every contribution is positive, and the column total is the information value.

Weight of evidence and information value, debt service cover
BinShare of goodsShare of badsDifferenceWoEIV contribution
Below 1.0015.89%27.97%−12.08%−0.56560.0683
1.00 to 1.2417.91%25.59%−7.68%−0.35670.0274
1.25 to 1.4921.42%19.26%2.16%0.10620.0023
1.50 to 1.9935.37%23.48%11.88%0.40950.0487
2.00 and above9.41%3.69%5.72%0.93520.0535
Information value0.2002

IV = Σ (share of goods − share of bads) × WoE

Lowest bin: (0.1589 − 0.2797) × (−0.5656) = (−0.1208) × (−0.5656) = 0.0683

Sum of the five: 0.2002

Excel: =SUMPRODUCT(ShareGood-ShareBad,WoE)

The weights rise monotonically with cover, which is what a lender would expect and what a regulator reviewing the card will look for. Two bins at the ends carry most of the value: the weakest cover and the strongest together contribute 0.1218 of the 0.2002.

Reading the number

The conventional reading treats an information value below 0.02 as not predictive, 0.02 to 0.1 as weak, 0.1 to 0.3 as medium, 0.3 to 0.5 as strong, and anything above 0.5 as suspicious. Run the same arithmetic on the other six characteristics of the sample and they rank as follows.

Information value of the seven usable characteristics
CharacteristicIVReading
Worst county court judgment0.2471Medium
Debt service cover0.2002Medium
Sector0.1208Medium
Net debt / EBITDA0.1082Medium
Bank conduct score0.0831Weak
Loan to value0.0293Weak
Age of business0.0201Weak

The ceiling of 0.5 is not decoration. The extract also holds days past due at month three, with an information value of 2.8606. Put it into the model and the area under the curve jumps from 0.7353 to 0.9125. It is also recorded three months after the money is lent, so it cannot decide a loan. An information value that high is a question about when the field was measured, not a reason to celebrate.

What if the bins change?

Information value is a property of the binning as much as of the field. Merging bins can never raise it, and usually lowers it. The question is how much separation is given up for weights that are stable and easier to defend.

Debt service cover under four binnings
BinningIVShare of five-bin IV
Five bins, as above0.2002100.0%
Two lowest merged (below 1.25)0.195497.6%
Two highest merged (1.50 and above)0.185992.9%
Three bins: below 1.25, 1.25 to 1.49, 1.50 and above0.181290.5%
Two bins, split at 1.250.161080.4%

Merging the two weakest bins costs almost nothing, 2.4 per cent, because their weights are close. Merging the two strongest costs 7.1 per cent, because the 2.00-and-above bin is genuinely different. That asymmetry is the practical guide: merge bins whose weights are close, keep apart bins whose weights differ.

The common mistake

The mistake is binning so finely that some bins are nearly empty. A bin with no bads has an infinite weight. The usual patch adds 0.5 to the empty count, which turns a hypothetical bin of 120 goods and no bads into a weight of 2.7839 and an information value contribution of 0.0558: more than the entire age-of-business characteristic, resting on zero observed defaults. Fine bins inflate information value with noise, and the inflated number then survives into variable selection. Keep every bin large enough to hold a meaningful number of bads, here a few dozen, and merge before patching.

The weights feed straight into the scorecard: points = −coefficient × WoE × factor. With the fitted coefficient of −1.089 on debt service cover and a factor of 28.8539, the 2.00-and-above bin earns 29.39 points and the bin below 1.00 loses 17.77. The scale itself is worked in scorecard points from PDO, factor and offset.

Takeaway

Information value ranks a field on its own; how well the finished score ranks is measured by Gini and KS. All seven bin tables, built from the 6,000 counts by formula, are in the free workbook for this case.

Questions readers ask

What is a good information value for a credit scorecard variable?

The usual rule of thumb reads below 0.02 as not predictive, 0.02 to 0.1 as weak, 0.1 to 0.3 as medium, 0.3 to 0.5 as strong and above 0.5 as suspicious. On the SME sample here the best usable field, the worst county court judgment, scores 0.2471. A field measured after the loan is made, days past due at month three, scores 2.8606: too good to be legitimate.

What do you do when a bin has zero bads?

The weight of evidence becomes infinite, because the logarithm of a share divided by zero has no value. Either merge the bin with its neighbour or add 0.5 to the empty count. A bin of 120 goods and no bads, with 0.5 bads added, gets a weight of 2.7839 and contributes 0.0558 of information value, a large number resting on no evidence. Merging is usually the better fix.

Does merging bins reduce information value?

It cannot increase it, and it usually reduces it a little. Merging the two highest debt service cover bins here takes the information value from 0.2002 to 0.1859, a loss of 7.1 per cent; collapsing to two bins split at 1.25 leaves 0.1610, or 80.4 per cent of it. Coarser bins trade a little separation for weights that are stable and monotonic.

Read the whole case

This article is one calculation from Machine Learning for Finance. The book takes the same case from first principles to the decision, chapter by chapter, and every figure it prints is a live formula in the free companion workbooks.

Get the book on Amazon →Free companion files

Also on Amazon UK · Amazon Germany · Amazon France · Amazon Canada

Also on this site

Reading guide: corporate finance, valuation and markets → · All 681 articles →

If this book helped, or didn’t, a few lines on Amazon are worth more than they look: they are what the next reader goes on. Write a review. The workbook stays free either way.