Training pipelines and quality gates
Turning training into small, repeatable stages that stop as soon as something is wrong.
A training pipeline runs the same stages every time: get and check data, train, evaluate, and decide. Each stage passes or fails with an exit code, so the pipeline stops at the first problem instead of producing a doubtful model.
Quality gates are the decisions: is the score above a threshold? Is the new model better than the current one on the same holdout data? Is it fair across groups, fast enough and small enough? A model that fails a gate is never registered or served.
Run small, quick versions on every pull request, and full training on a schedule or after merge. Pin package versions and random seeds so a run can be repeated.
Cost. Free to practise locally or in a public GitHub repository.
Use it when
- training is done by hand from a notebook.
- a worse model once reached production.
- you want model changes reviewed like code changes.
How it works
- Data checks
- Row counts, missing values, drift.
- Train
- Fixed seeds and pinned packages.
- Evaluate
- Scores on held-back data, against a baseline.
- Gate
- Threshold and champion comparison.
- Register
- Only if every gate passed.
Options
- A script
- Simple and readable; fine for one model.
- GitHub Actions or Azure Pipelines
- Pull request checks and schedules.
- Azure ML or Kubeflow pipelines
- Managed stages, caching and compute for heavy training.
Example. Larkfield Group's weekly forecast once trained on half the usual data after an export failed. Adding a row-count check and an error gate meant the next bad export stopped the pipeline and paged the team, and the old forecast stayed in use.
Don't confuse it with
- Threshold gate
- Is the model good enough at all?
- Champion gate
- Is it better than what we use now?
Words to know
- Quality gate
- A check a model must pass to move on.
- Exit code
- 0 means success; anything else stops the pipeline.
- Pinned versions
- Exact package versions written down.
Where to look
- mlops folder
- train.py --min-auc
- pipeline.py
Practise it
- Stop weak models with a quality gateHow-to, Free
- Train and gate a model in a pipelineHow-to, Free
- Final project: a pipeline from data to scored ordersHow-to, Free
Read it in the guide, next to the tasks and labs.
Open in DevOps, Hands On