Concept
Detecting data distribution shift
Tell covariate, label and concept shift apart, and pick a test that compares live data with the training baseline.
Covariate shift
- What changes
- Input distribution
- Example
- A new age group signs up
- How you see it
- Feature tests, no labels needed
Label shift
- What changes
- Share of each answer
- Example
- Fraud becomes rarer
- How you see it
- Prediction or label rates change
Concept drift
- What changes
- Input-to-answer link
- Example
- Buyers change what they want
- How you see it
- Quality metrics fall once labels arrive
| Shift | What changes | Example | How you see it |
|---|---|---|---|
| Covariate shift | Input distribution | A new age group signs up | Feature tests, no labels needed |
| Label shift | Share of each answer | Fraud becomes rarer | Prediction or label rates change |
| Concept drift | Input-to-answer link | Buyers change what they want | Quality metrics fall once labels arrive |
1 / 2
Covariate shift
- What changes
- Input distribution
- Example
- A new age group signs up
- How you see it
- Feature tests, no labels needed
Label shift
- What changes
- Share of each answer
- Example
- Fraud becomes rarer
- How you see it
- Prediction or label rates change
| Shift | What changes | Example | How you see it |
|---|---|---|---|
| Covariate shift | Input distribution | A new age group signs up | Feature tests, no labels needed |
| Label shift | Share of each answer | Fraud becomes rarer | Prediction or label rates change |
2 / 2
Concept drift
- What changes
- Input-to-answer link
- Example
- Buyers change what they want
- How you see it
- Quality metrics fall once labels arrive
| Shift | What changes | Example | How you see it |
|---|---|---|---|
| Concept drift | Input-to-answer link | Buyers change what they want | Quality metrics fall once labels arrive |
KS test
- Fits
- Continuous feature
- Reads as
- Largest gap between cumulative curves
PSI
- Fits
- Binned feature
- Reads as
- Under 0.1 stable, over 0.25 large shift
Chi-square
- Fits
- Categorical feature
- Reads as
- Category counts differ from baseline
JS divergence
- Fits
- Any distribution
- Reads as
- Symmetric distance, zero means equal
Embedding distance
- Fits
- Text and images
- Reads as
- How far new inputs sit from training
| Test | Fits | Reads as |
|---|---|---|
| KS test | Continuous feature | Largest gap between cumulative curves |
| PSI | Binned feature | Under 0.1 stable, over 0.25 large shift |
| Chi-square | Categorical feature | Category counts differ from baseline |
| JS divergence | Any distribution | Symmetric distance, zero means equal |
| Embedding distance | Text and images | How far new inputs sit from training |
1 / 2
KS test
- Fits
- Continuous feature
- Reads as
- Largest gap between cumulative curves
PSI
- Fits
- Binned feature
- Reads as
- Under 0.1 stable, over 0.25 large shift
Chi-square
- Fits
- Categorical feature
- Reads as
- Category counts differ from baseline
| Test | Fits | Reads as |
|---|---|---|
| KS test | Continuous feature | Largest gap between cumulative curves |
| PSI | Binned feature | Under 0.1 stable, over 0.25 large shift |
| Chi-square | Categorical feature | Category counts differ from baseline |
2 / 2
JS divergence
- Fits
- Any distribution
- Reads as
- Symmetric distance, zero means equal
Embedding distance
- Fits
- Text and images
- Reads as
- How far new inputs sit from training
| Test | Fits | Reads as |
|---|---|---|
| JS divergence | Any distribution | Symmetric distance, zero means equal |
| Embedding distance | Text and images | How far new inputs sit from training |
What it is
When live data stops looking like the training data, quality falls, often with no error and no alarm. Drift monitoring compares a recent window of serving data with a fixed baseline, usually the training set, one feature at a time.
Covariate shift: the inputs change, the link to the answer stays, for example a new customer group. Label shift: the share of each answer changes, for example fraud becomes rarer. Concept drift: the link itself changes, so the same input now deserves a different answer. The first two show without labels. Concept drift shows only when ground truth arrives and quality metrics fall.
What it is
Each test fits a feature type. The Kolmogorov-Smirnov (KS) test suits continuous features: it measures the largest gap between two cumulative distributions. The Population Stability Index (PSI) compares binned shares: below 0.1 is stable, 0.1 to 0.25 moderate, above 0.25 large. Chi-square compares category counts. Jensen-Shannon (JS) divergence is a symmetric distance, zero when the distributions match.
What it is
Text and images have no columns, so compare embeddings: embed recent inputs with the training-time model and measure the distance from the training embeddings, for example between the two centres. When a score crosses the threshold, alarm, check the upstream pipeline for a break, and retrain on fresh data if the shift is real.
Remember
- KS: continuous. Chi-square: categories. PSI: binned shares. JS: distance.
- Concept drift needs ground truth: watch model quality.
On the exam
- “Inputs differ from training, no labels yet” points to covariate shift and a KS or PSI test.
- “Same inputs, but customers now behave differently” points to concept drift, seen in falling quality.
- “Compare a categorical feature, training versus production” points to chi-square.
Do not mix it up with
Amazon SageMaker Model MonitorCapture endpoint traffic, compare it with a baseline on a schedule, and alarm on violations.
- Performance baselines and drift detectionCompare live data and predictions with a baseline made from training data, and raise an alert on violations.
- Shadow variants and A/B testsTest a new model on a live endpoint by splitting traffic (A/B) or by mirroring it to a shadow copy that no user sees.