Validation and governance

Discrimination: ROC-AUC, Gini, and KS

Measure ranking ability while keeping class balance, horizon, and threshold context visible.

Visual summary of Discrimination: ROC-AUC, Gini, and KS: Measure ranking ability while keeping class balance, horizon, and threshold context visible.
A visual overview of Measure ranking ability while keeping class balance, horizon, and threshold context visible. See the guide for assumptions and implementation details.

Purpose

Define common discrimination measures and explain what they do not tell a reviewer.

Hover over or focus a term for a quick definition, or open its glossary entry.

  • Discrimination
  • Calibration
  • ROC-AUC

Key definitions

  • ROC-AUC measures ranking across thresholds for a binary outcome.
  • Gini is commonly expressed as 2×AUC−1 under a stated convention; KS compares cumulative score distributions.
Formula
Gini = 2×ROC-AUC−1; KS = maxₜ |F_bad(score≤t) − F_good(score≤t)| under the chosen score orientation.

Worked example

An AUC of 0.70 corresponds to Gini 0.40 under the common transformation; it does not mean 70% of individual decisions are correct.

Detailed explanation

Discrimination metrics ask whether higher-risk cases tend to rank ahead of lower-risk cases. ROC-AUC integrates true-positive and false-positive rates across thresholds. Gini is a linear transformation commonly used in credit score reporting. KS measures the maximum separation between cumulative score distributions, with direction depending on score orientation.

Report event and non-event counts, confidence intervals where useful, horizon, population, and segmentation. Compare over time using consistent definitions and note that AUC is insensitive to some forms of prevalence change. Pair ranking metrics with calibration, threshold performance, stability, and operational outcomes. No one metric or cutoff universally validates a credit model.

Try a reproducible Python example

These examples use synthetic inputs and run locally in a browser worker. Edit the code, run it, and compare its output with the published example.

Runnable Python · local in your browser

Monitor observed-to-expected and Brier score

Compare a small set of matured binary outcomes against predicted PD values.

Output

Run the code to see the output.

Runtime loads only after you press Run. Code runs in a separate browser worker with a 10-second limit and a 20,000-character output cap. Use synthetic examples only; browser execution is not a secure environment for secrets or sensitive records.

Runnable Python · local in your browser

Calculate ROC-AUC, Gini, KS, precision, and recall

Use synthetic out-of-sample scores and matured labels. Higher scores indicate higher risk; the example computes pairwise ROC-AUC and a threshold-specific operating point.

Output

Run the code to see the output.

Runtime loads only after you press Run. Code runs in a separate browser worker with a 10-second limit and a 20,000-character output cap. Use synthetic examples only; browser execution is not a secure environment for secrets or sensitive records.

Assumptions

  • The validation sample has defined positive class, observation unit, target horizon, and sufficient events.

Limitations

  • Discrimination does not establish calibration or acceptable customer outcomes.
  • AUC can look stable while default rates or segment performance change.

References

Educational material only. Methods and examples are simplified; state and validate the assumptions required for your use case.

Discrimination: ROC-AUC, Gini, and KS | CreditRiskHub