Model validationBrowser-sideKS + AUC + Gini

Credit Risk KS Statistic & Score Band Analyzer

Measure how well a credit score separates good from bad. Get the KS statistic, the full score-band table with bad rate and lift, the cut-off of maximum separation, and AUC and Gini — from a CSV of scores and a binary target, or from counts you have already binned.

Open the calculator
Your file is parsed in the browser. Scores are never uploaded.
Inputs
Provide raw scores and a target, or enter the bads and goods per band directly.

One score per row. Any monotonic scale works.

1 = bad (event), 0 = good (non-event).

More bands bring the KS closer to the exact value.

Result
Recomputed as you type, entirely in this tab.
Paste scores and a 0/1 target, or load the sample file, to see the KS and score bands.

How the KS statistic is calculated

KS turns two overlapping score distributions into one number: how far apart the model manages to push goods and bads.

Formula
KS = max over bands | cumulative %bads − cumulative %goods |

Reported on a 0–100 scale. AUC is the area under the ROC curve the bands trace, and Gini is 2 × AUC − 1. All three come from the same band table on this page.

1. Rank by score
Sort the population by score and split it into bands, normally ten deciles, from the lowest score to the highest.
2. Accumulate each class
Walking through the bands, track the running share of all bads and of all goods captured so far.
3. Take the widest gap
KS is the largest distance between the two cumulative curves. The band where it happens is a natural cut-off.
KS strength
The conventional reading in scorecard validation.
KSReading
< 20Weak separation
2060Acceptable — where most scorecards sit
6075Strong
> 75Suspiciously high — check for leakage

These bands are conventions, not statistical tests. What counts as good depends on the portfolio, and a stable KS over time matters as much as a high one.

Reading the score bands

A clean scorecard shows the bad rate falling smoothly from the lowest score band to the highest, with lift above 1 in the risky bands and below 1 in the safe ones. That monotonic pattern is the sign the score is rank ordering.

The KS column peaks in the middle of the range and returns to zero at the ends, because the cumulative curves must both start at 0 and finish at 100%. The peak band is where a single approve or decline cut-off separates goods from bads best.

Because KS here is read at the band boundaries, deciles give a slightly conservative figure. Use more bands when you need the reported value to track the exact empirical KS closely.

Take the validation back to your notebook

A single KS is a spot check. Validating a scorecard means recomputing KS, AUC, and the band table on every refresh and every out-of-time sample, on data that never leaves your environment. Copy the Python above into your own notebook, or let an agent with a live Jupyter kernel keep the validation run reproducible.

Open Runcell

FAQ

Common questions about the KS statistic, score bands, and how they relate to AUC and Gini.