AI in Finance & Fraud · Lesson 5 of 8

Credit Risk Modelling & Scorecards

⏱ 10 min read✅ Check-yourself quiz🏦 Banking & fintech

Credit risk models estimate the chance a borrower won't repay. They decide who gets a loan, how much and at what price, so they are among the most regulated models in any bank. This lesson covers PD/LGD/EAD, scorecards with WoE and IV, and how ML fits in.

The building blocks

Classic scorecard workflow

  1. Define the target: "bad" = 90+ DPD within 12 months of the application; exclude indeterminate cases.
  2. Binning: split each variable into bins with monotonic bad rates (e.g. age, income, utilisation).
  3. Weight of Evidence: for each bin, WoE = ln(%good / %bad).
  4. Information Value: IV = Σ (%good − %bad) × WoE. A common rule of thumb is < 0.02 useless, 0.02–0.1 weak, 0.1–0.3 medium, > 0.3 strong (and check for leakage if suspiciously high).
  5. Logistic regression on the WoE-transformed variables.
  6. Scaling to points: score = offset + factor × ln(odds), often "20 points to double the odds" (PDO).
import numpy as np, pandas as pd
def woe_iv(df, col, target="bad", bins=5):
    d = df[[col, target]].copy(); d["bin"] = pd.qcut(d[col], bins, duplicates="drop")
    g = d.groupby("bin", observed=True)[target].agg(["sum", "count"]); g["good"] = g["count"] - g["sum"]
    g["pg"] = (g.good + .5) / g.good.sum(); g["pb"] = (g["sum"] + .5) / g["sum"].sum()
    g["woe"] = np.log(g.pg / g.pb); iv = ((g.pg - g.pb) * g.woe).sum()
    return g[["count", "sum", "woe"]], iv

Where gradient boosting fits

Evaluation for credit models

Fairness and regulation

Check yourself

What is expected loss and how is it computed? EL = PD × LGD × EAD: the probability of default times the share lost if default happens times the exposure at default. It drives pricing, provisions and capital planning.
Why use monotonic constraints in a credit GBM? They enforce business logic (e.g. more missed payments can only increase risk). That makes the model stable, explainable and acceptable to validators and regulators.
What does PSI measure? How much a variable's distribution (or the score distribution) has shifted between a baseline period and a recent one. A large PSI signals population drift that may require recalibration.
Created by Ajeetkumar