Sub topic 3
Skew, Data Drift, and Concept Drift: How They Differ
Assume you know basic Python and pandas, understand supervised learning, and have seen a model deployed through an API or batch job. You should also be comfortable with means, histograms, and simple distributions.
A production model can become inaccurate for different reasons. The features may change because the production code differs from the training code. The real-world population may change. Or the relationship between features and the target may change. These problems look similar in model metrics, but they need different fixes.
Training-serving skew
Training-serving skew is a difference between the features used during training and the features provided to the model in production.
For example, suppose training fills a missing age with the training mean, 40. The serving API fills the same missing value with 0. The model receives valid numeric input in both cases, so no error occurs. However, it learned from one meaning of “missing” and predicts with another.
Skew often comes from:
- Different feature transformation code.
- Different data sources or SQL queries.
- Different column names, units, or time zones.
- Different rules for missing, unknown, or invalid values.
- Training with features available after the prediction time.
Skew compares two data paths: training and serving. It does not require production data to change over time.
Data drift
Data drift, also called covariate shift, is a change in the distribution of input features over time. The production data may no longer resemble the data used to train the model.
For example, a fraud model trained on transactions with an average value of $60 may later receive transactions averaging $200 because the product or customer base changed. The serving code may be perfectly consistent with the training code. The inputs themselves have changed.
Data drift concerns the input distribution, often written as a change in P(X), where X represents the features. It can reduce accuracy when the model performs poorly on the new region of the feature space.
Concept drift
Concept drift is a change in the relationship between features and the target. In notation, P(Y|X) changes, where Y is the target and X is the input.
A spam model may learn that messages containing a certain phrase are usually unwanted. Later, legitimate newsletters may adopt that phrase. The feature distribution can remain similar, but the meaning of the feature has changed.
Concept drift usually requires delayed labels to detect. Monitoring only feature distributions cannot prove that concept drift occurred.
Compare the failure modes
| Problem | Main comparison | Typical evidence | First response |
|---|---|---|---|
| Training-serving skew | Training features versus serving features | A parity test fails | Fix and redeploy the feature pipeline |
| Data drift | Current production features versus a baseline | PSI or KS test flags a feature | Investigate population or product changes |
| Concept drift | Current labels versus predictions and features | Accuracy or calibration falls | Review labels, retrain, or change the model |
A single incident can contain more than one problem. A new customer population can cause data drift, while a separate missing-value bug causes skew. Check the feature-generation path before retraining. Retraining on incorrectly generated data can hide the bug without fixing it.
Exercise
A model's training and serving transformations match exactly, but the average input value has doubled since deployment. Which problem should you investigate first?
Show answer
Data drift. The production input distribution changed even though the two transformation paths remain consistent.