Bucketwise Sign in free

Learn / Models

How to validate a credit scorecard: Gini, KS and PSI explained

Validating a scorecard means answering three questions. Does it rank customers correctly? Is the population it sees still the one it was built on? Do its predicted bad rates match what happens? Gini and KS answer the first. PSI answers the second. Calibration answers the third.

One table to work from

Take a development sample of 1,180 customers scored and split into five bands, band 1 being the lowest scores. A customer is bad if they reached the bad definition in the observation window. The counts are made up.

BandGoodsBadsCumulative goodsCumulative badsGap
1 (lowest scores)1006010.0%33.3%23.3%
22005030.0%61.1%31.1%
33004060.0%83.3%23.3%
42502085.0%94.4%9.4%
5 (highest scores)15010100.0%100.0%0.0%

Cumulative means the share of all goods, or all bads, in this band and every band below it. A good scorecard collects bads in the low bands, so the cumulative bad share climbs faster than the cumulative good share.

What is KS?

KS is the largest gap between the two cumulative shares. In the table it is 31.1%, at band 2: 61.1% of the bads sit in the bottom two bands against 30.0% of the goods.

A higher KS means the score separates goods from bads better. It also shows where: band 2 is where the cut-off does the most work on this sample. There is no universal pass mark. Compare KS with the development value and with your policy.

What is Gini?

Plot cumulative bads against cumulative goods, from the lowest score upwards. The area under that curve is the AUC. Gini = 2 x AUC - 1. A score with no ranking power lies on the diagonal and has a Gini of 0. A perfect score has a Gini of 1.

Same table, trapezoid rule
AUC0.696
Gini2 x 0.696 - 1 = 0.39

Gini and KS measure the same ability in different ways. A fall in Gini over time is the classic sign that rank-ordering is weakening. Compare it with the development value, on a recent cohort that has had time to show its outcome.

SQL for the table above

One row per band with goods, bads, cumulative shares and the gap. KS is the largest gap. The input is a table of development customers, one row each, with their score band and a bad flag.

WITH b AS (
  SELECT band,
         SUM(CASE WHEN bad = 0 THEN 1 ELSE 0 END) AS goods,
         SUM(CASE WHEN bad = 1 THEN 1 ELSE 0 END) AS bads
  FROM   scores_dev
  GROUP  BY band
),
c AS (
  SELECT band, goods, bads,
         1.0 * SUM(goods) OVER (ORDER BY band) / SUM(goods) OVER () AS cum_good,
         1.0 * SUM(bads)  OVER (ORDER BY band) / SUM(bads)  OVER () AS cum_bad
  FROM   b
)
SELECT band, goods, bads, cum_good, cum_bad,
       ABS(cum_good - cum_bad) AS gap
FROM   c
ORDER  BY band;

We ran this on the table above and the output matches the numbers shown.

What is PSI?

Population stability index compares the share of customers in each score band today with the share at development. The formula is the sum, over bands, of (current share - development share) x ln(current share / development share).

Same example as the scorecard guide: three bands
Development shares30%, 40%, 30%
Current shares20%, 40%, 40%
PSI0.041 + 0 + 0.029 = about 0.07
SELECT SUM((c.share - d.share) * LN(c.share / d.share)) AS psi
FROM  (SELECT band, 1.0 * COUNT(*) / SUM(COUNT(*)) OVER () AS share
       FROM   scores_dev GROUP BY band) d
JOIN  (SELECT band, 1.0 * COUNT(*) / SUM(COUNT(*)) OVER () AS share
       FROM   scores_now GROUP BY band) c
  ON   c.band = d.band;

Common rule of thumb: below 0.10 stable, 0.10 to 0.25 watch, above 0.25 investigate. Treat the bands as starting points and set your own policy. The query reproduces 0.069 on these inputs.

What these three do not tell you

Mistakes that make the numbers look fine

What should you put in the validation note?

Try it on your own tables

The free tools give you the prompt, the checks and how to present the result. You enter table names only.

See the free tools

Frequently asked questions

What is the difference between Gini and KS?

Both measure how well a score separates goods from bads. KS is the largest gap between the cumulative good and bad shares. Gini is twice the area under the cumulative curve, minus one.

What is a good Gini for a credit scorecard?

There is no universal pass mark. It depends on the product, the data and the population. Compare with the development value and with your policy.

What PSI value is acceptable?

A common rule of thumb reads below 0.10 as stable, 0.10 to 0.25 as worth watching, and above 0.25 as needing investigation.

How often should a scorecard be validated?

Often enough that a drop in ranking power or a shift in population shows up before it affects decisions. Many teams monitor PSI monthly and Gini once cohorts have matured. Set the schedule in your model policy.

Keep reading