← Back to Classic ML Mind Map
📊 Classic MLID: psi-data-drift

Data Drift & PSI

数据漂移与 PSI
🎯Core Definition
PSI (Population Stability Index) is the most common metric for monitoring input-distribution drift, quantifying the binned divergence between the baseline (e.g. training) distribution and the current one: PSI=∑i(Ai−Bi)ln⁡AiBiPSI = \sum_i (A_i - B_i)\ln\frac{A_i}{B_i}, where AiA_i is the share of actual samples falling in bin ii and BiB_i the expected share; bins are typically deciles of the baseline distribution, empty actual bins are merged with neighbors to avoid division by zero, and PSI is essentially a symmetrized KL divergence. Rule of thumb: PSI<0.1PSI < 0.1 stable; 0.1≤PSI<0.250.1 \le PSI < 0.25 needs investigation; PSI≥0.25PSI \ge 0.25 signals significant drift and triggers retraining. Two drift types: covariate drift (P(X)P(X) changed, e.g. a new customer mix) and concept drift (P(Y∣X)P(Y|X) changed, e.g. default rates rose during COVID).
💡Use Cases
a must-have on weekly/monthly monitoring dashboards for credit and anti-fraud models; interview questions like "how do you detect model degradation in production" or "what to do when PSI exceeds the threshold"; compute per-feature PSI to rank offending variables, or one overall PSI over the model score, then localize root causes by PSI ranking.
⚡Key Problems Solved
unlike watching only online metrics such as AUC (labels arrive late, and no localization of the offending feature), PSI detects input-distribution drift per feature ahead of labels; combined with tiered thresholds (<0.1<0.1 stable / 0.1-0.250.1\text{-}0.25 watch / >0.25>0.25 drift) and retraining triggers, it closes the monitor—diagnose—retrain loop.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Data Drift & PSI.
Use Cases
In production engineering, what are the primary use cases for Data Drift & PSI and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Write PSI=∑i(Ai−Bi)ln⁡AiBiPSI = \sum_i (A_i - B_i)\ln\frac{A_i}{B_i} and define AiA_i/BiB_i; why is PSI = 0 when Ai=BiA_i = B_i? How does it relate to KL divergence?
2
PSI thresholds <0.1 / 0.1–0.25 / >0.25 and the action for each; how to handle zero bins (Bi=0B_i = 0 or Ai=0A_i = 0)?
3
Covariate drift vs concept drift: definitions, one real example each, and how each affects the model differently?
4
Why monitor PSI instead of online AUC alone? What are PSI's limitations (e.g. sensitivity to binning)?
5
The action pipeline when PSI ≥ 0.25 (attribute → retrain → rollback); how to distinguish real drift from data leakage or definition changes (feature/口径 change)?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Data Drift & PSI"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardSHAP & LIMENext Card →Learning to Rank

🔗 More Classic ML Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/ML/card/psi-data-drift
中文速览与面试要点

数据漂移与 PSI (Data Drift & PSI)

定义: PSI(Population Stability Index,群体稳定性指标)是监控模型输入分布漂移最常用的指标,量化基准分布与当前分布的分箱差异: PSI = _i (A_i - B_i) A_iB_i,其中 A_i 是当前(actual)样本落入第 i 个分箱的比例,B_i 是基准(expected,如训练集)比例;分箱通常按基准分布十等分,当前分箱为空时与相邻箱合并避免除零,PSI 本质上是 KL 散度的对称化近似。经验阈值: PSI 0.25 漂移)与重训触发,形成“监控—归因—重训”闭环。

核心要点

  • 写出 PSI 公式 PSI = _i (A_i - B_i) A_iB_i 并解释 A_i/B_i 的含义;为什么 A_i = B_i 时 PSI = 0?它与 KL 散度是什么关系?
  • PSI 经验阈值: 0.25 各代表什么处置动作?分箱时遇到 B_i = 0 或 A_i = 0 怎么处理?
  • Covariate Drift 与 Concept Drift 的区别?各举一个实际例子,两者对模型的影响有何不同?
  • 为什么监控模型退化要用 PSI 而不是只看线上 AUC?PSI 的局限性有哪些(如对分箱数敏感)?
  • 检测到 PSI ≥ 0.25 后的处置流程(归因→重训→回滚);如何区分真实漂移与数据泄漏/口径变化?