What This Module Covers

A drift alert tells you the model has decayed. It does not tell you how to ship a replacement without betting the whole system on a model you trained in a hurry and have not yet watched on live traffic. That distance — between knowing a model needs to change and changing it safely — is the loop the entire track has been building toward, and this module closes it. You build continuous integration that tests data and models rather than only code, and a retraining pipeline that rolls out a new version behind a gate, so the signals from the monitoring module become the trigger for a safe, automatic improvement instead of a scramble. A deploy that once took months becomes a routine that takes three days.

A drift alert tells you the model has decayed. It does not tell you how to ship a replacement without betting the whole system on a model you trained in a hurry and have not yet watched on live traffic. That distance — between knowing a model needs to change and changing it safely — is the loop the entire track has been building toward, and this module closes it. You build continuous integration that tests data and models rather than only code, and a retraining pipeline that rolls out a new version behind a gate, so the signals from the monitoring module become the trigger for a safe, automatic improvement instead of a scramble. A deploy that once took months becomes a routine that takes three days.

What this module is

MLOps is the discipline of changing a machine-learning system in production without breaking it. CI/CD is the automation that carries a change from a commit to a running service through gates that can stop it. For ordinary software, CI tests the code. For an ML system, the code is only one of the things that can be wrong: the data can drift, a feature can leak, a retrained model can be worse than the one it replaces, and none of those is a code bug a unit test would catch.

This module builds CI/CD for an ML system specifically. It tests the data the way you test the code, gates promotion on whether the new model actually beats the baseline rather than on whether the build is green, treats a retraining loop as something that can poison itself if you feed it its own mistakes, and ships a new version by exposing it to a little traffic before all of it. The judgment it teaches is that “the pipeline passed” and “the model improved” are different claims, and an MLOps system has to check the second one.

What you will learn

The module moves through five lessons, from a green pipeline to a retraining loop you can trust to improve the system on its own.

  • Get a CI pipeline going green. Build a real pipeline that runs on every push, installs the locked dependencies, runs the tests, and builds the artifact on a clean machine. You will learn that a pipeline is a compiled graph of isolated jobs rather than a script, that passing on a fresh runner is what makes it CI and not “works on my machine,” and why you order stages cheapest-failure-first.
  • Make CI catch bad data. A test suite that checks only code passes while malformed data silently degrades the model. You will treat data as a second input that must be tested — asserting schema, types, ranges, and nullability at the boundary — and catch the leakage that makes a model look brilliant in validation and fail in production.
  • Gate the model and version it. A green build does not mean a good model. You will gate promotion on a metric that survives class imbalance rather than accuracy, which a majority-class guess can ace, and version the model as its artifact plus the data snapshot and seed that produced it — because a model you cannot reproduce is one you cannot audit or roll back.
  • Retraining: the loop that can hurt you. Automatic retraining is how a model keeps up with drift, and also how it poisons itself: train on labels its own predictions influenced, or on data a feedback loop has skewed, and each cycle makes it worse while every metric you log looks fine. You will build the loop with the guards that keep it from degrading itself.
  • Roll out safely, and keep it that way. A new model version that passed every gate can still be wrong on live traffic. You will shadow it on the real stream with zero blast radius, canary it to a bounded slice, then go full — and standardize the path so a deploy that once took months stays a three-day deploy.

The module ends with a project on the Phase 3 starter: wire CI and retraining around the running Adult / Census Income service — a pipeline that goes green on a clean runner, data tests that fail the build on a bad-data commit, a model gate on an imbalance-aware metric with a versioned manifest, a written retraining runbook whose default answer is “hold,” and a staged rollout with a one-line rollback. The package stays fixed at v2.1.0; retraining produces new model artifacts, not new package versions. The lessons work the techniques on the Lending Club pipeline; the project is where you prove the operating discipline yourself, against a rubric that maps line by line to these lessons.

How it builds on what came before

This module automates the discipline every earlier module taught by hand. The locked dependencies from the Python module are what CI installs on a clean runner; the data contracts from the wrangling module become the schema CI asserts; the baseline and the imbalance-aware metrics from the foundations module become the gate that blocks a worse model; the serialized artifact from the classical-ML module becomes the versioned, reproducible thing you promote; the drift detection from the monitoring module becomes the trigger that starts a retraining run. The whole track has been building a system that works and that you can see; this module makes it a system that improves itself safely. It is where every guarantee the earlier modules established becomes something CI enforces on every change instead of something a careful engineer remembers to check.

What you will be able to do

By the end you will build a CI pipeline that goes green only on a clean machine, test the data as rigorously as the code and catch leakage before it ships, gate model promotion on a metric that imbalance cannot fool, version a model as artifact-plus-inputs so it is reproducible and reversible, run a retraining loop with the guards that stop it poisoning itself, and roll out a new version shadow-then-canary-then-full so a bad model is caught on a sliver of traffic instead of all of it. The thread through all five lessons is the same: the pipeline passing is necessary, the model improving is the point, and an MLOps system is the machinery that refuses to ship the first without proving the second.

This lesson is part of Pro

The Ship a Machine Learning Product path — every lesson, capstone, and the failure modes free tutorials skip. Sign in if you already have Pro, or unlock it below.

Unlock with Pro Sign in