← Apps ← My Digital Space

When the world moves,
your model forgets.

A machine learning model is trained on a snapshot of the world. But the world doesn't sit still. Data drift is the quiet erosion of accuracy when the data your model meets in production no longer resembles the data it learned from.

~30%
typical accuracy drop in production within 12 months
PSI
standard metric for detecting distribution shift
3
main types of drift you'll learn to spot
TRAINING_DATA ⊙ PRODUCTION_DATA ✕ DECISION_BOUNDARY ┄
STATUS: STABLE

A model is a photograph.
Production is a river.

Every model is trained on data collected during a specific window of time. The model learns the statistical patterns of that window — and freezes them. But the real world keeps changing. Customers evolve. Sensors age. Seasons turn. The gap between the photograph and the river is drift.

STEP 01

Train

A model learns the relationship between features X and targets Y from historical data. The data defines everything the model knows.

STEP 02

Deploy

The model is shipped to production. Predictions start flowing. Everything looks fine — for a while. But the input distribution has already begun to shift, slowly, invisibly.

STEP 03

Drift

Without warning, accuracy degrades. The model is asked to make predictions on data it has never seen — and its assumptions no longer hold. The cost of silence grows.

Push the distribution.
Watch the model break.

Below is a binary classifier trained on two Gaussian classes. Use the sliders to shift the production data and watch drift metrics respond in real time. Red circles are misclassified points.

FEATURE_SPACE STABLE
training
production
misclassified
DRIFT_CONTROLS
0.00
0.00
1.00
LIVE_METRICS
ACCURACY
100.0%
classification rate
PSI
0.000
population stability
KS
0.000
KS statistic
Drift severity NONE
00.1 (warning)0.25 (critical)0.5+
FEATURE_X_DISTRIBUTION histogram, 14 bins
FEATURE_Y_DISTRIBUTION histogram, 14 bins

Not all drift is created equal.
Three distinct failures, three distinct signatures.

P(X) changes

Covariate Drift

The input features change distribution, but the relationship between features and target stays the same. A spam filter trained on emails from 2019 sees emojis it never learned.

P(X) → changed  ·  P(Y|X) → same
P(Y|X) changes

Concept Drift

The relationship between features and target changes. What was true yesterday is false today. Interest rates rise, and suddenly yesterday's loan-risk model is wrong about everyone.

P(X) → same  ·  P(Y|X) → changed
P(Y) changes

Label Drift

The proportion of classes shifts. A fraud-detection model trained on 1% fraud rate now sees 8% — the prior is wrong, and calibrated probabilities no longer match reality.

P(Y) → changed  ·  class balance shifted
REAL_WORLD EXAMPLES
E-commerce

A recommender trained on summer browsing patterns sees winter search behavior. Shorts become coats. Click rates collapse.

Credit risk

A recession changes which income brackets default. The model still expects 2019 default rates — and underprices risk everywhere.

Medical imaging

A new MRI scanner produces images with different contrast. The model trained on the old scanner misclassifies healthy tissue as lesions.

Drift is rarely sudden.
It is a slow burn.

Press play and watch twelve months of a model's life. Drift accumulates silently. Detection thresholds fire. Without intervention, accuracy decays toward random chance.

Month 0
Accuracy 98.0%
PSI 0.00
Healthy accuracy
Drift warning (PSI > 0.1)
Critical drift (PSI > 0.25)
Retraining event

Three statistical tools
to measure the gap.

PSI

POPULATION_STABILITY_INDEX

Buckets both distributions into the same bins, compares the share of points in each. PSI is symmetric and forgiving — the workhorse of industry drift monitoring.

PSI = Σ (pi − qi) × ln(pi / qi)
PSI < 0.1Negligible drift
0.1 – 0.25Warning — investigate
PSI > 0.25Critical — retrain

KS Test

KOLMOGOROV–SMIRNOV

Computes the empirical CDF of each distribution and finds the largest vertical gap between them. Distribution-free, exact for 1D, and excellent for continuous features.

KS = max |Fn(x) − Gm(x)|
KS < 0.05Same distribution
0.05 – 0.15Moderate shift
KS > 0.15Significant shift

KL Div.

KULLBACK–LEIBLER DIVERGENCE

Measures the information-theoretic cost of using distribution Q when the truth is P. Asymmetric — useful when you care about a specific reference direction.

DKL(P ‖ Q) = Σ pi × ln(pi / qi)
D ≈ 0Distributions match
0.05 – 0.5Noticeable divergence
D > 0.5Severe divergence
WHAT_TO_DO_ABOUT_IT
01

Monitor

Track PSI, KS, and prediction distributions continuously. Alert before accuracy drops.

02

Investigate

Identify which features drifted, when it started, and whether upstream data sources changed.

03

Retrain

Add recent labeled data to your training set. Weight newer samples if drift is severe.

04

Adapt

Online learning, domain adaptation, or rolling training windows keep models current.

NOTIFICATION
Message