download

Feature PSI jumped to 0.34. Should you retrain the model?

Machine learning~12 minReviewed 3 Dec 2026Free · No sign-in

Question

Your fraud monitor alerts on order_amount this week. Compare the training share p against this week's live share q across four buckets:

order_amount binBaseline pCurrent q
<$500.450.25
$50-$1490.350.35
$150-$4990.150.20
$500+0.050.20

Chargebacks take up to 30 days to settle. Last week's 1,000 orders had 40 true frauds, yet only 10 chargebacks have arrived by day 7.

  1. Compute the Population Stability Index (PSI).
  2. Explain why you should not retrain automatically, contrasting input/covariate shift against concept drift.
  3. What breaks if you retrain today on last week's labels?
Show hints (3)
  1. "COMPUTE PSI PER BIN"

    Sum (q - p) * ln(q / p) over all four bins. Which single bin produces more than half of the total?

  2. "INPUTS VS LABELS"

    PSI measures whether inputs P(x) moved. It cannot tell whether the fraud rate inside each bin P(y|x) changed, or whether a unit bug hit the pipeline.

  3. "CHECK UNSETTLED CHARGEBACKS"

    At day 7, 30 of the 40 frauds have not been reported yet. If you build training labels today, what label do those 30 frauds receive?

Show checked explanation

No, diagnose before retraining. Here PSI is 0.340 (above the 0.25 alert threshold), driven mostly by $500+ orders quadrupling from 5% to 20%. First rule out pipeline bugs and benign traffic mix shifts (P(x) change). Retrain only when settled labels show concept drift (P(y|x) degradation), never on immature 7-day chargebacks that undercount fraud 4x.

"SOLUTION · PYTHON"
import math
from fractions import Fraction

# (bin_label, baseline_share p, current_share q)
bins = [
    ("<$50", 0.45, 0.25),
    ("$50-$149", 0.35, 0.35),
    ("$150-$499", 0.15, 0.20),
    ("$500+", 0.05, 0.20),
]
psi = 0.0
for label, p, q in bins:
    term = (q - p) * math.log(q / p)
    psi += term
    print(f"{label:9} p={p:.2f} q={q:.2f} term={term:.3f}")

print(f"Total PSI = {psi:.3f} (alert > 0.25)")
true_rate = Fraction(40, 1000)
day7_rate = Fraction(10, 1000)  # only 25% of chargebacks settled
print(f"7-day rate={float(day7_rate):.1%} vs true={float(true_rate):.1%}")
"OUTPUT"
<$50      p=0.45 q=0.25 term=0.118
$50-$149  p=0.35 q=0.35 term=0.000
$150-$499 p=0.15 q=0.20 term=0.014
$500+     p=0.05 q=0.20 term=0.208
Total PSI = 0.340 (alert > 0.25)
7-day rate=1.0% vs true=4.0%

Code and PSI calculations run on CPython 3.12.10 (stdlib only) against the bin table and delayed-label fixture above; official SciPy and NIST documentation links checked by the author. Checked by an editor other than the author.

Walkthrough

Population Stability Index measures how far an input distribution q moved from baseline p: PSI = sum((q - p) * ln(q / p)), which equals the symmetric Kullback-Leibler divergence KL(q || p) + KL(p || q). Common rules of thumb flag 0.10 to 0.25 as moderate shift and > 0.25 as major shift.

BinBaseline pCurrent qln(q / p)PSI term
<$500.450.25-0.5880.118
$50-$1490.350.350.0000.000
$150-$4990.150.20+0.2880.014
$500+0.050.20+1.3860.208

The total PSI is 0.340, well above 0.25. One bin ($500+) generates 61.2% of the alert (0.208 / 0.340).

1. Check data quality before touching the model. A sudden jump in $500+ orders often means an upstream schema or unit bug, such as cents sent instead of dollars or broken currency conversion. Retraining on bad inputs bakes the bug straight into model weights. Fix the pipeline first.

2. Separate covariate shift from concept drift. Suppose inputs are clean. Two different things can happen:

  • Benign covariate shift (P(x) changes, P(y|x) stays fixed). A B2B sale brings more $500+ baskets, yet $500+ orders still have the same fraud risk as before. If the model already learned that region well, precision and calibration hold steady. Retraining adds little unless $500+ was sparse in training.
  • Concept drift (P(y|x) changes). Fraudsters shift tactics so a once-safe segment turns risky, or calibration breaks on fresh settled labels. Now retraining (often with new features or recent weighting) is warranted.

3. Respect label maturity before retraining. Chargebacks take up to 30 days to arrive. On last week's 1,000 orders, only 10 of 40 frauds are visible at day 7. Treating the 30 pending frauds as 0 cuts the training fraud rate from 4.0% to 1.0% (a 4x drop) and makes the retrained model severely under-predict risk.

Common mistakes

  • Triggering automatic retraining whenever PSI > 0.25. Retraining cannot fix a broken upstream unit conversion and wastes effort on benign traffic shifts.
  • Confusing covariate shift with concept drift. PSI inspects only P(x); you need settled labels (or strong proxy outcomes) to prove P(y|x) degraded.
  • Training on immature recent windows. Using 7-day-old orders for a 30-day chargeback label treats 30 pending frauds as legit and distorts predicted probabilities.
  • Passing a zero bin proportion straight into ln(q / p). Empty bins cause division by zero or ln(0); floor empty bins with a tiny constant like 1e-6.

Follow-up questions

  • "If chargebacks take 30 days to settle, how do you detect concept drift before a whole month passes?" Track fast leading proxies alongside 30-day chargebacks: manual review overturn rates, bank decline codes, customer dispute tickets, and score-bucket calibration on cases that already settled. Use those fast signals to adjust thresholds or rules while waiting for mature training labels.
  • "You find that $500+ traffic really grew 4x from a new enterprise product, and the old model only saw 50 such rows in training. What do you do?" Wait for enough mature $500+ labels (or prioritize human audits on a stratified sample of $500+ orders), then retrain with the expanded slice and re-check slice calibration. Meanwhile, guard high-value orders with tighter review thresholds or business rules.

What a strong answer covers

Computes PSI = 0.340 and spots $500+ driving 61.2% of the jump. Checks schema and unit bugs first, separates P(x) covariate shift from P(y|x) concept drift, and refuses to retrain on immature 7-day labels (1.0% vs 4.0%).

Open in interactive practice deck →

Original OfferVibe question. Joao Gama et al., "A Survey on Concept Drift Adaptation" (ACM Computing Surveys, 2014); Naeem Siddiqi, Credit Risk Scorecards (Wiley, 2006) · SciPy Relative Entropy (scipy.stats.entropy) · NIST AI RMF 1.0.
© 2026 OfferVibe · Text CC BY-NC-SA 4.0 · code MITFree to share and adapt with credit, not for commercial use. Code samples are free for any use.