# Monitoring, Drift and Model Maintenance

> Detect when production data or model quality drifts away from what you trained on, and decide when to retrain. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/machine-learning/model-monitoring
Last updated: 2026-11-28

Detect when production data or model quality drifts away from what you trained on, and decide when to retrain.

Advanced · about 6 hours · difficulty 3/5

Learn first: [Serving Models with FastAPI and BentoML](https://www.internhack.in/roadmaps/tracks/machine-learning/model-serving), [Statistics for Data Science](https://www.internhack.in/roadmaps/tracks/machine-learning/statistics)

A model's accuracy on launch day is its best day. Customer behaviour shifts, upstream pipelines change, and the world moves on. Without monitoring you learn about it from angry users.

### What can go wrong

- **Data drift (covariate shift)**: input distributions change, for example a new user segment.
- **Concept drift**: the relationship between inputs and target changes, for example fraud patterns adapt.
- **Label shift**: the class balance moves.
- **Data quality bugs**: a column becomes all nulls, units change, a category is renamed.
- **Training-serving skew**: features are computed differently online than in training.

### What to monitor

- **Operational**: latency, error rates, throughput, resource use.
- **Inputs**: null rates, ranges, category frequencies, and drift statistics such as **PSI**, KL divergence or Kolmogorov-Smirnov tests.
- **Outputs**: prediction distribution and confidence.
- **Quality**: real metrics once labels arrive; use proxies (click-through, complaints) while you wait.

### Tools and practice

Log every request and prediction with a model version. **Evidently**, WhyLabs or NannyML compute drift reports; Prometheus and Grafana handle dashboards and alerts. Set alert thresholds carefully: drift in an unimportant feature is noise. Decide in advance whether retraining is scheduled, triggered by drift, or triggered by a drop in measured quality, and keep humans in the loop for high-stakes models.

**Good enough to move on** when your deployed model has dashboards and alerts for inputs, outputs and latency, and you have a written plan for what happens when an alert fires.

## Key concepts

- **Data drift vs concept drift**
- **Training-serving skew**
- **Drift statistics (PSI, KS test)**
- **Prediction and label logging**
- **Evidently reports**
- **Prometheus and Grafana alerts**
- **Retraining strategies**

## Mini project

Simulate drift by replaying a dataset in time order through your served model, log inputs and predictions, generate Evidently drift reports per week, and trigger an alert and retraining job when PSI crosses a threshold.

## Check yourself

How would you tell data drift apart from concept drift, and why can you detect one before labels arrive but not the other?

## Free resources

- [Evidently documentation](https://docs.evidentlyai.com/) (Evidently AI)
- [Made With ML](https://madewithml.com/) (Made With ML)
- [Prometheus documentation](https://prometheus.io/docs/introduction/overview/) (Prometheus)

Previous: [ML Pipelines, Orchestration and CI/CD](https://www.internhack.in/roadmaps/tracks/machine-learning/ml-pipelines-cicd) · Next: [Feature Stores](https://www.internhack.in/roadmaps/tracks/machine-learning/feature-stores)

## More in MLOps: Shipping and Operating Models

- [From Notebook to Production Code](https://www.internhack.in/roadmaps/tracks/machine-learning/notebook-to-production-code)
- [Experiment Tracking with MLflow and Weights and Biases](https://www.internhack.in/roadmaps/tracks/machine-learning/experiment-tracking)
- [Data and Model Versioning with DVC](https://www.internhack.in/roadmaps/tracks/machine-learning/data-versioning)
- [Docker for ML](https://www.internhack.in/roadmaps/tracks/machine-learning/docker-for-ml)
- [Serving Models with FastAPI and BentoML](https://www.internhack.in/roadmaps/tracks/machine-learning/model-serving)
- [ML Pipelines, Orchestration and CI/CD](https://www.internhack.in/roadmaps/tracks/machine-learning/ml-pipelines-cicd)
- [Monitoring, Drift and Model Maintenance](https://www.internhack.in/roadmaps/tracks/machine-learning/model-monitoring)
- [Feature Stores](https://www.internhack.in/roadmaps/tracks/machine-learning/feature-stores)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Machine Learning Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/machine-learning)
