Model Drift Lab

Model Fitting Model Monitoring

Watch a prediction model degrade in real time as customer data shifts beneath it. Diagnose which features drifted, retrain to recover, and learn when monitoring alerts should fire across the model lifecycle.

👨‍🏫 Professor Mode: Guided Learning Experience

New to model drift? Enable Professor Mode for step-by-step guidance through watching data shifts degrade model performance!

OVERVIEW & WHAT THIS TOOL SOLVES

Shipping an accurate churn or lead-scoring model is only half the job. In live marketing operations, customer behavior, ad channels, and economic conditions shift continuously, causing model accuracy to decay quietly. Model Drift Lab simulates the post-deployment lifecycle over 18–24 months: watch Covariate Drift (shifting customer inputs) erode model F1, diagnose which features shifted with Population Stability Index (PSI) and Kolmogorov–Smirnov (KS) statistics, and retrain to recover performance. (Concept Drift, where the behavioral rules themselves change, is explained below for contrast but not simulated.)

🎯 Questions It Answers

  • Is our deployed prediction model degrading because incoming customer profiles shifted (covariate drift) or because customer behavior itself changed (concept drift)?
  • Which specific input features have crossed the PSI ≥ 0.25 alert threshold, and which show the largest KS gap?
  • How much F1-score, accuracy, and retained revenue do we recover by retraining the model on fresh post-drift data?

📂 What Data You Need

  • 4 Built-In Lifecycle Scenarios: E-Commerce Churn, Programmatic Ad CTR, Subscription Retention, and B2B Lead Scoring
  • Reference Window: The first three months after launch (Months 1–3), establishing expected feature distributions
  • Monitoring Stream: Every later monthly cohort (Month 4 to the end of an 18- to 24-month timeline), compared against the reference window

💡 What You'll Discover

  • Live Performance Timeline: Month-by-month F1 for your model against never-retrained and retrained-monthly references, with a drift onset marker
  • Feature Drift Diagnostic Table: Per-feature PSI scores, KS statistics, and green/amber/red traffic-light alerts
  • Retraining Recovery Comparison: A before vs. after accuracy table for every retrain, with the recovery visible on the F1 timeline
🔍 Key Nuances & Common Traps to Watch For
  • Covariate Drift vs. Concept Drift: Covariate drift means P(X) changed (e.g., a new TikTok campaign brings in younger shoppers, shifting the age distribution) while P(Y|X) stayed the same. Concept drift means P(Y|X) changed (e.g., a competitor launches a cheaper plan, so the same usage level now churns at twice the old rate).
  • Why PSI Can Stay Green During Pure Concept Drift: PSI and KS compare only input feature distributions between the training window and today. If customers look identical on paper while their buying rules have changed, PSI stays < 0.10 even as your F1-score crashes. Monitor both input drift (PSI/KS) and outcome performance (F1/AUC).
  • Industry PSI Alert Thresholds: PSI < 0.10 indicates a stable distribution (green); 0.10 ≤ PSI < 0.25 signals moderate shift to investigate (amber); PSI ≥ 0.25 indicates major drift requiring model recalibration or retraining (red).
📐 Under the Hood: Model Equations & Variable Definitions

1. Population Stability Index (PSI) & Two-Sample Kolmogorov–Smirnov (KS) Statistic

\[ \text{PSI} = \sum_{b=1}^{B} \left( p_b^{\text{mon}} - p_b^{\text{ref}} \right) \ln\!\left( \frac{p_b^{\text{mon}}}{p_b^{\text{ref}}} \right), \qquad \text{KS} = \sup_{x} \bigl| F_{\text{ref}}(x) - F_{\text{mon}}(x) \bigr| \]

💬 Read it in plain English: PSI bins a feature into deciles and sums the symmetric divergence between today's bin shares and the training baseline's bin shares. The KS statistic finds the single widest vertical gap between the training and monitoring cumulative distribution curves.

PSI
Population Stability IndexINFERENCE ⓘ
Symmetric Kullback-Leibler divergence across B bins (< 0.10 stable, 0.10–0.25 moderate, ≥ 0.25 major drift).
B
Number of Quantile BinsYOUR DATA ⓘ
Count of reference-distribution bins (typically B = 10 deciles) used to discretize continuous features.
pbref, pbmon
Reference & Monitoring Bin SharesESTIMATED ⓘ
Proportion of observations falling into bin b during the baseline training window vs. current monitoring period.
KS
Kolmogorov–Smirnov StatisticINFERENCE ⓘ
Maximum absolute vertical distance (0 to 1) between the empirical CDFs F_ref(x) and F_mon(x).
Fref(x), Fmon(x)
Empirical Cumulative DistributionsESTIMATED ⓘ
Fraction of observations ≤ x in the reference training window vs. the monitoring window.

2. Classification Performance Metrics (Precision, Recall & F1-Score)

\[ \text{Precision} = \frac{\text{TP}}{\text{TP} + \text{FP}}, \qquad \text{Recall} = \frac{\text{TP}}{\text{TP} + \text{FN}}, \qquad F_1 = \frac{2 \cdot \text{Precision} \cdot \text{Recall}}{\text{Precision} + \text{Recall}} \]

💬 Read it in plain English: Precision measures how many flagged customers actually churned (avoiding wasted retention offers), and Recall measures what share of actual churners the model caught. F1 is their harmonic mean, so it falls sharply whenever either Precision or Recall drops.

F1
Harmonic Mean of Precision & RecallOUTPUT ⓘ
Balanced classification accuracy metric on [0, 1] used to track model degradation over time.
Precision
Positive Predictive ValueOUTPUT ⓘ
Share of predicted positives (TP + FP) that are true positives (TP).
Recall
Sensitivity / True Positive RateOUTPUT ⓘ
Share of actual positives (TP + FN) successfully flagged by the model.
TP, FP, FN
Confusion Matrix CountsYOUR DATA ⓘ
True Positives, False Positives (false alarms), and False Negatives (missed events) at the active threshold.

UNDERSTANDING DRIFT: WHY MODELS BREAK

Before loading a scenario, walk through what model drift is, why it happens, and how to spot it before accuracy drops.

📊

Data Drift (Covariate Shift)

The input features change distribution: customer ages skew older, ad spend shifts, or seasonal patterns break. The model was trained on a population that no longer matches reality.

Training Production SHIFT
Example: Your churn model was trained when average customer tenure was 18 months. A viral campaign brings a flood of new customers, pulling average tenure down to 6 months. The feature distributions shift even though underlying churn behaviour stays the same.
🟢 Detectable EARLY PSI & KS statistics catch this before accuracy drops.
🔄

Concept Drift (Posterior Shift)

The relationship between inputs and outcomes changes: the same customer profile that used to churn now stays (or vice versa). Features look stable, while the mapping from features → target has broken.

Same distribution, new meaning old boundary new boundary ?
Example: A competitor launches a loyalty program. Customers with the same demographics and spending patterns now stay, so the meaning of a "likely churner" changed while the customer data stayed the same.
🔴 Harder to detect early PSI misses it; it shows up only when accuracy drops.

📝 This lab simulates data drift (covariate shift). Concept drift is shown for contrast so you know what PSI can and cannot catch.

🔑 Leading vs. Lagging Indicators

Month 1 Month 6 Month 10 Month 14 Month 18 PSI ↑ F1 ↓ ← PSI already rising ← F1 finally drops EARLY WARNING WINDOW
PSI (Feature Drift) LEADING: catches distribution shifts before they hurt accuracy, giving you an early alarm.
F1 Score LAGGING: drops only after drift has been underway for a while, though unlike accuracy, F1 drops whenever drift hurts the model’s real job.

Watch for this gap in the scenarios below. The feature drift chart (PSI bars) often lights up months before the F1 line starts falling, giving you time to act before performance erodes. Also compare accuracy against F1: sometimes accuracy stays flat while F1 craters, a pattern called the accuracy paradox.

MARKETING SCENARIOS

Select a scenario above to load a marketing case study and explore model drift interactively.

👆 Select a marketing scenario above to begin exploring model drift.