The machine learning lifecycle
The steps every model goes through, from a business question to a model in use and back again.
Every model follows the same loop. Start with a question worth answering (which orders will be late?). Gather data with known answers. Split it so some is kept back. Train on the rest. Evaluate on the kept-back data against a baseline. Deploy the model. Monitor it, and when the world changes, go round again.
The commonest mistakes happen at the edges of the loop: testing on data the model already saw (scores look great, then fall apart in use), no baseline (a model that only matches guessing), and no plan for monitoring (the model quietly gets worse).
Treat a trained model like a build output: it should be reproducible from the same code, data and settings, versioned, and replaceable.
Cost. Free to practise on your own computer.
Use it when
- you're starting your first model project.
- a model's real results don't match its test scores.
- you need to explain the process to a manager or auditor.
How it works
- Question
- What decision will the model help with?
- Data
- Examples with known answers, checked for quality.
- Train and test
- Fit on one part, score on another.
- Deploy
- Batch or online, from a registry.
- Monitor
- Drift, real outcomes, retraining.
Options
- Simple model first
- Logistic regression: fast, explainable, a strong baseline.
- More complex model
- Forests or boosting: often more accurate, harder to explain.
Example. SS Kaiser's first late-delivery model was a logistic regression trained in an afternoon. It beat the baseline clearly, so the team shipped it as a nightly batch first and only tried more complex models once the whole loop worked.
Don't confuse it with
- Training data
- What the model learns from.
- Test or holdout data
- What the model is judged on; it never trains on it.
Words to know
- Baseline
- The score with no real model.
- Overfitting
- Learning the training data so closely that new data scores badly.
- Data leakage
- Information about the answer sneaking into the inputs, making test scores too good.
Where to look
- mlops folder
- train_basic.py
Practise it
Read it in the guide, next to the tasks and labs.
Open in DevOps, Hands On