KatInterview

Diagnose a Churn Model That Collapses Out of Time

Machine LearningModel answer
HardModel answerMachine Learningdata-leakagefeature-driftmodel-calibration

Last updated

Given a binary classifier with train AUC 0.95, random-split val AUC 0.62, and time-holdout AUC 0.55, systematically identify and fix every failure mode.

The Situation

You inherit a churn prediction pipeline. The model is a gradient-boosted classifier trained on monthly customer snapshots. The business uses its output to target a retention campaign, so both ranking quality and predicted probabilities matter.

When you look at the evaluation results, you see this:

SplitAUC
Training set0.95
Random 20% holdout0.62
Most recent month (time-based)0.55

A few more observations:

  • Predicted probabilities cluster near 0 and 1 — the model is overconfident.
  • Positive class prevalence is roughly 1:10 (one churner for every nine non-churners).
  • The pipeline uses a target encoder, a gradient-boosted tree, and SMOTE oversampling.

What You Need to Do

Walk through a complete debugging process. Your answer should cover:

  1. Reading the metrics — what each gap most likely signals before you touch any code
  2. Data integrity and leakage checks — how you identify temporal leakage, label immaturity, and train-only leakage
  3. Validation scheme — why random splits are wrong here and what to use instead
  4. Label and feature drift analysis — techniques and thresholds you would apply
  5. Error analysis — calibration inspection, slice-level breakdowns, and threshold-dependent metrics
  6. Ablations and feature audits — the specific experiments you would run and what each isolates
  7. Training fixes — regularization, class-imbalance handling, and calibration correction
  8. Verification and regression prevention — how you confirm an improvement is real and keep it from regressing

Be concrete: name metrics, thresholds, specific methods, and the order you would tackle things.

Hints

Hint 1

Start by mapping each metric gap to its most likely cause before running a single experiment. The train-vs-random-val gap and the random-val-vs-time-holdout gap point to different problems and call for different fixes.

Hint 2

Ask whether the most recent month's labels are even trustworthy. If a churn label requires 30 days of post-snapshot inactivity and the holdout is from last month, some labels may not have had time to resolve — this alone can push AUC toward 0.5.

Hint 3

SMOTE resampling to 1:1 on a 1:10 problem systematically inflates predicted probabilities by roughly 10×. There is a closed-form correction formula, but recalibration with Platt scaling on a held-out temporal fold is often cleaner.