▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
MLOps: Shipping ML Models · Lesson 9 of 14 · 2 min read · 5 min video
CI/CD for machine learning
Automatic tests, model checks and deployments on every change.
📄 Download slides (PDF)· free sign-upCI/CD (continuous integration and continuous delivery) means every change is tested and deployed automatically. ML needs it even more than regular software, because a model can be wrong without anything crashing.
What CI checks in ML
On every pull request:
- Code tests: unit tests for features, data loading and the API
- Data tests: schema and range checks on a sample
- Training smoke test: train on a small sample to make sure the pipeline still runs
- Model tests: the model still meets minimum quality on a fixed test set, and gives sensible answers to known examples
A GitHub Actions example
Behaviour tests for models
Accuracy alone can hide problems. Add simple checks that make sense to a person:
- A bigger flat in the same area shouldn't be predicted to cost less
- Changing only the owner's name shouldn't change a loan decision
- Known tricky examples still get the right answer
CD: delivering a model
When a change merges:
- Build the Docker image and tag it with the commit
- Deploy to staging and run the tests against it
- Promote to production, ideally to a small share of traffic first
- Keep the previous version ready for a one-click rollback
Who approves?
Automatic deploys are fine for code fixes. For a new model version, many teams add a human approval step after reviewing the evaluation report.
In one line
CI/CD for ML tests code, data and model behaviour on every change, then builds, stages and rolls out models automatically, with a quick way back if something goes wrong.
Share with a friend