Lesson 5 of 6 Evaluating ML Models

Creating Performance Baselines and Detecting Drift

This lesson explains how evaluation results form a baseline of expected quality and data characteristics, and how drift detection compares live behaviour against it to signal when a model needs attention.

Learning outcomes

After completing this lesson, you will be able to:

  • Create model performance and data baselines.
  • Implement drift detection with data capture and monitoring schedules.
  • Act on drift with alarms and retraining.

Creating baselines

There are two kinds of baseline. A model performance baseline records metrics such as AUC, recall or RMSE on validation data, and often a simple reference model, such as predicting the majority class or last week's value, so improvements are measured against something meaningful. A data baseline records the statistics of training data. SageMaker Model Monitor's suggest_baseline runs a processing job that writes statistics.json (distributions, means, completeness per feature) and constraints.json (expected types, completeness and value ranges).

True or false

What a baseline is

Exam skills 2.3.2

Check what a performance baseline should be.

Log in to try this activity Interactive activities are free with an account.

Implementing drift detection

To detect drift, enable data capture on the endpoint so requests and responses are stored in S3, then create monitoring schedules that compare captured data with the baseline hourly or daily. Model Monitor reports violations, publishes per-feature metrics to CloudWatch and can be extended with custom statistics. Model quality monitoring additionally needs ground-truth labels, which are uploaded later and merged with captured predictions. Batch transform outputs can be monitored the same way.

The following diagram shows the baselines for a demand forecasting model and when each of its monitoring schedules raises an alarm.

Baselines and monitoring for the demand model. The model's validation MAPE of 12% is the promotion bar, well ahead of the naive same-week-last-year forecast at 21%. A daily data quality schedule watches price and promo distributions, and a weekly model quality schedule alarms above 15% MAPE once sales arrive; when a price war starts, the daily data alarm fires days before the weekly check.
The day the price war starts is illustrative.
Put in order

Set up drift detection

Exam skills 2.3.2 · 4.1.3

Arrange the steps for detecting data drift on a deployed model.

Log in to try this activity Interactive activities are free with an account.

From detection to action

Detecting drift is useful only if it leads to action. CloudWatch alarms on drift metrics notify the team, or trigger a retraining pipeline automatically through Amazon EventBridge. Thresholds must balance sensitivity against noise: small, expected shifts, such as seasonal changes, may not warrant retraining, while sudden large shifts usually do.

Production monitoring is covered in depth in the Monitoring Models in Production module. The following table summarises the baseline artefacts that drift detection compares against.

ArtefactContainsUsed by
Validation metricsAUC, recall, RMSE and so onModel quality monitoring, promotion decisions
statistics.jsonPer-feature distributionsData quality monitoring
constraints.jsonTypes, ranges, completeness rulesViolation checks
Reference model scoreNaive baseline performanceJudging whether the model adds value
Worked example

Baseline for a demand model

A demand forecasting model reaches MAPE 12% on validation, while a naive forecast (same week last year) scores 21%. Model Monitor creates a data baseline from the training set.

  • Promotion rule: new versions must beat 12% MAPE and stay well ahead of the naive 21%.
  • Data quality schedule: daily, alarm when the distribution of price or promo_flag drifts beyond the baseline distance threshold.
  • Model quality schedule: weekly, after actual sales arrive, alarm if MAPE exceeds 15%.

When a competitor's price war changes price distributions, the data quality alarm fires days before the weekly MAPE check would have shown the drop.

Check yourself

What does suggest_baseline produce?

Show answer

statistics.json and constraints.json, which Model Monitor compares live data with.

Exam Tips

Remember for the exam

  • suggest_baseline produces statistics.json and constraints.json.
  • Drift detection needs data capture on the endpoint.
  • Model quality monitoring needs ground-truth labels.
  • Compare models against a naive reference baseline.
  • Drift alarms can trigger retraining through EventBridge.