Lesson 1 of 4 Monitoring Models in Production

Monitoring Deployed Models with SageMaker Model Monitor

This lesson explains SageMaker Model Monitor, which continuously compares production data and predictions with baselines and reports violations, the core of a drift detection pipeline.

Learning outcomes

After completing this lesson, you will be able to:

  • Enable data capture on an endpoint.
  • Distinguish the four monitor types.
  • Choose monitors for a model.

Data capture

Monitoring a model starts with recording what it receives and returns. Data capture, enabled in the endpoint configuration, records a configurable percentage of requests and responses to Amazon S3 as JSON Lines files, optionally encrypted with AWS KMS. Batch transform jobs can capture their inputs and outputs too.

Captured data is the input for every Model Monitor monitor: data quality, model quality, bias drift and feature attribution drift. It also provides a record for debugging individual predictions and for building future training data.

True or false

Data capture

Exam skills 4.1.3

Check how endpoint data capture works.

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

The four monitor types

Data quality monitoring compares feature statistics with a baseline from training data, detecting missing values, type changes, out-of-range values and distribution drift. Model quality monitoring merges captured predictions with ground-truth labels uploaded later and computes metrics such as accuracy, precision, recall, AUC or RMSE against a baseline. Bias drift monitoring uses Clarify to track post-training bias metrics over time. Feature attribution drift monitoring uses Clarify to detect changes in SHAP feature importance.

Each monitor runs as a monitoring schedule (for example, hourly or daily) that launches a processing job. Results go to S3 as reports and to CloudWatch as metrics; violations can raise alarms. Custom monitoring scripts can compute additional statistics. The SageMaker Model Dashboard shows monitoring status for all models.

Sort into groups

Which monitor?

Exam skills 4.1.3 · 2.3.2

Choose the Model Monitor type that detects each problem.

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

Choosing monitors

Model Monitor offers four types of monitor, each detecting a different kind of problem. Data quality monitoring compares incoming feature statistics with a baseline from the training data. Model quality monitoring compares predictions with ground-truth labels when they become available. Bias drift monitoring tracks Clarify bias metrics over time, and feature attribution drift monitoring tracks changes in which features drive predictions. Most production models need data quality monitoring at least, and the others depend on whether labels arrive and whether fairness matters. The following table summarises the monitor types.

MonitorDetectsNeeds
Data qualityInput schema and distribution changesBaseline from training data
Model qualityFalling accuracy or rising errorGround-truth labels merged with predictions
Bias driftChanges in post-training bias metricsClarify configuration, facet, labels
Feature attribution driftChanges in feature importanceClarify SHAP baseline

The following diagram shows the schedule of each monitor for a credit model against the 90 days it takes for defaults to become known.

The credit model's monitoring plan against the 90-day label delay. Data capture records every request. Data quality runs hourly and feature attribution drift daily, both without labels; bias drift runs weekly on the regulator's facets; and model quality runs weekly but can only judge decisions whose defaults have matured, 90 days later.
Markers show schedule frequency, not exact run times.
Worked example

A credit model's monitoring plan

A credit model is deployed in a regulated market. Defaults become known 90 days after a decision.

  • Enable data capture at 100% with KMS encryption.
  • Data quality schedule hourly: early warning of input changes, because labels arrive late.
  • Model quality schedule weekly, merging default outcomes as they mature.
  • Bias drift schedule weekly on age group and gender facets, as required by the regulator.
  • Feature attribution drift schedule daily, to catch changes in how decisions are made.

Relying only on model quality monitoring would leave a 90-day blind spot, which data quality and attribution monitoring fill.

Check yourself

Which monitors use SageMaker Clarify?

Show answer

Bias drift and feature attribution drift monitors.

Exam Tips

Remember for the exam

  • Monitoring needs data capture enabled on the endpoint.
  • Model quality monitoring needs ground-truth labels.
  • Bias drift and feature attribution drift monitors use Clarify.
  • Results are published to CloudWatch for alarms.
  • When labels arrive late, rely on data quality monitoring for early warning.