MLOps & Production

Data Drift vs Concept Drift

Why models that hit 99% accuracy in offline testing decay silently 3 months after deployment.

🟡 intermediate4 min readmonitoringmust-know
Data Drift (Covariate Shift) occurs when feature input distributions P(X) change over time while target rules P(Y|X) remain fixed. Concept Drift occurs when the relationship between features and target P(Y|X) changes. Detecting drift requires statistical tests like Population Stability Index (PSI), Kolmogorov-Smirnov (KS) test, and adversarial drift classifiers. Mitigations range from feature re-scaling to retraining schedules.

Defining Covariate Shift vs Concept Shift vs Prior Shift

Model predictions depend on the joint distribution P(X, Y) = P(X) · P(Y | X) = P(Y) · P(X | Y).

Type of Drift           What Changes?             What Stays Constant?
──────────────────────────────────────────────────────────────────────────
Data Drift (Covariate)   P(X) changes              P(Y | X) unchanged
Concept Drift           P(Y | X) changes          P(X) can be constant
Prior Shift             P(Y) changes              P(X | Y) unchanged

Detection Methods (PSI, KS Test, Drift Classifiers)

MethodData TypeMechanics
Population Stability Index (PSI)Categorical & Binned NumericPSI = ∑ (Actual% - Expected%) × ln(Actual% / Expected%). PSI ≥ 0.25 signals severe drift.
Kolmogorov-Smirnov (KS) TestContinuous NumericNon-parametric test comparing cumulative distributions (CDF). Low p-value (< 0.05) rejects null hypothesis of identical distributions.
Adversarial Drift ClassifierHigh-dimensional vectors / textTrain GBDT on (Train Data = 0, Serving Data = 1). If classifier AUC > 0.7, significant drift exists. Feature importances reveal which features drifted.

Mitigation Strategies & Retraining Triggers

  1. Rule-Based Triggers: Retrain when PSI > 0.25 or when production performance drops below SLA.
  2. Scheduled Retraining: Retrain daily, weekly, or monthly on rolling time windows.
  3. Domain Adaptation / Importance Weighting: Weight training samples by P_prod(X) / P_train(X) to correct covariate shift without full retraining.
  4. Feature Dropping: Remove highly volatile features that drift rapidly without driving major predictive signal.

Say this out loud

"Data drift is a shift in feature distributions P(X), while concept drift is a shift in the target relationship P(Y|X). We detect data drift without labels using PSI, KS tests, or adversarial classifiers trained to separate training logs from production logs. When concept drift occurs, model performance degrades and requires retraining on newly collected, newly labelled data."

Follow-ups to expect

Check yourself

Question 1 of 3

A sudden macroeconomic shock changes consumer purchasing behaviour so that a credit scoring model's inputs X remain identical, but default rates P(Y|X) double. This is an example of

More in MLOps & Production

See all →
What to Monitor in Production5 minPoint-in-Time Correct Feature Joins5 minDebugging a Production Model Incident5 min