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 — the complete model lifecycle in one interactive lab.

👨‍🏫 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 a high-accuracy churn or lead-scoring model is only half the battle—in live marketing operations, customer behavior, ad channels, and macroeconomic conditions shift continuously, causing model accuracy to silently decay. Model Drift Lab simulates the complete post-deployment lifecycle over 18–24 months: watch Covariate Drift (shifting customer inputs) erode model F1 (Concept Drift, a change in the behavioral rules themselves, is explained for contrast but not simulated), diagnose which features shifted using Population Stability Index (PSI) and Kolmogorov–Smirnov (KS) statistics, and trigger retraining to recover performance.

🎯 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 only compare input feature distributions between the training window and today. If customers look identical on paper but their buying rules changed, PSI will stay < 0.10 while your F1-score crashes—which is why you must 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 worth investigating (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, while 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), Recall measures what fraction of actual churners the model caught, and F1 is their harmonic mean—falling sharply whenever either Precision or Recall degrades.

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 exploring the scenarios, let's build intuition for what model drift is, why it happens, and — critically — how to see it coming before accuracy drops.

📊

Data Drift (Covariate Shift)

The input features change distribution — customer ages skew older, ad spend distributions shift, seasonal patterns break. The model was trained on a world 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 — average tenure drops to 6 months. The feature distributions shift, even though churn behaviour hasn't fundamentally changed.
🟢 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, but the mapping from features → target is broken.

Same distribution, new meaning old boundary new boundary ?
Example: A competitor launches a loyalty program. Customers with the same demographics and spending patterns that used to churn now stay — the definition of a "likely churner" changed, not the customer data itself.
🔴 Harder to detect early PSI won't catch it — only shows up when accuracy drops.

📝 This lab simulates data drift (covariate shift). Concept drift is shown here for contrast — understanding the difference is part of the learning.

🔑 The Key Insight: 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. This is your early alarm.
F1 Score LAGGING — only drops after drift has been happening for a while. But unlike accuracy, F1 always drops when drift hurts the model’s real job.

As you explore the scenarios below, watch for this gap. You'll see the feature drift chart (PSI bars) light up months before the F1 line starts falling. That gap is precisely why we monitor data drift, not just model performance. And watch what happens to accuracy vs. F1 — sometimes accuracy stays flat while F1 craters. That's 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.