A model trained on last year’s transactions may behave differently this year. Even if the software code does not change, the world supplying the inputs can change. Monitoring detects when model behavior or operating conditions no longer match expectations.
Data drift versus concept drift
Data drift usually refers to a change in the distribution of inputs: for example, a loan model starts receiving applications from a different age or income mix. Concept drift refers to a change in the relationship between inputs and the outcome: for example, a previously predictive purchasing pattern stops predicting repayment behavior.
In symbols, data drift may change , while concept drift changes . These changes can occur together. Drift does not automatically prove performance got worse, and stable feature distributions do not guarantee performance remains good.
What should be monitored?
| Layer | Measurements | What they can reveal |
|---|---|---|
| Service | Request errors, latency, memory | Operational instability |
| Inputs | Missingness, ranges, category frequencies | Data pipeline faults and possible drift |
| Predictions | Class mix, confidence, abstention rate | Changed model behavior |
| Outcomes | Accuracy, recall, MAE, calibration | Actual task effectiveness |
| Subgroups | Error rates by relevant slices | Uneven failures concealed by averages |
A traffic spike may be a normal event. Missing values may be a pipeline bug rather than genuine change in users. Monitoring should provide context, not just alarms.
Comparing distributions
Simple checks compare proportions, quantiles, missing-value rates, or statistical distances between a baseline period and a new period. For numeric features, histograms help reveal shifts. Tests such as the Kolmogorov–Smirnov test compare distributions, but statistical significance depends strongly on sample size.
A distance threshold is not a universal rule. Tune alerts to known variability, data volume, and the costs of missed failures versus false alarms.
A small example of input shift
import numpy as np
baseline = np.array([10, 11, 10, 12, 9, 11], dtype=float)
current = np.array([16, 18, 17, 15, 18, 16], dtype=float)
print('Baseline mean:', baseline.mean())
print('Current mean:', current.mean())
print('Difference:', current.mean() - baseline.mean())
The means differ, but six observations per group are not enough to diagnose a production problem. In real monitoring, use appropriate sample windows, distributions, and operational context.
Ground-truth labels often arrive late
A fraud model may make a prediction today, but confirmed fraud status may not arrive until weeks later. Early checks can examine data quality and prediction shifts. Later, once trustworthy labels arrive, evaluate genuine model performance on the corresponding prediction cohort.
Do not compare predictions from one group with labels from another. Align timestamps and record identifiers carefully.
What to do after an alert
- Confirm that the metric and data pipeline are correct.
- Investigate whether the change is seasonal, expected, or concerning.
- Measure task outcomes and subgroup effects where labels exist.
- Consider recalibration, a changed threshold, retraining, rollback, or temporarily routing decisions for human review.
- Validate the proposed intervention on representative holdout data before release.
Blindly retraining on every shift risks incorporating bad labels or amplifying an incident. Some changes call for revising the problem definition rather than updating weights.
Related concepts
- Model Training, Overfitting, and Generalization
- The Machine Learning Lifecycle and MLOps
- Evaluating Machine Learning Models
References
Related articles in
- Clustering and K-Means — Learn how unsupervised clustering discovers groups in data, how K-Means optimizes cluster centroids, and how to evaluate and use its results responsibly.
- Data, Model, and Experiment Versioning — Learn to trace ML results to exact datasets, code revisions, configurations, and artifacts.
- Decision Trees, Random Forests, and Boosting — Learn how decision trees partition data, how random forests reduce variance through bagging, and how boosting combines sequential learners to improve predictions.