AILearn AI
LearnGlossarySources
ID/EN
Learn AI — open material for learning AIEvery lesson cites its original sources.
⚙ML Development & MLOps
  1. The ML development stack
  2. The ML lifecycle & MLOps maturity
  3. Experiment tracking with MLflow
  4. Model Registry, data versioning & lineage
  5. Deployment & model serving
  6. Monitoring, data drift & concept drift
  7. CI/CD, continuous training & feature stores
Modules
  1. ◎ AI Foundations
  2. ∿ Classical Machine Learning
  3. ⌬ Neural Networks
  4. ↘ Training Results & Evaluation
  5. ▦ Deep Learning Architectures
  6. ✎ Large Language Models
  7. ◐ Image Generation
  8. ♪ Audio & Speech AI
  9. ◈ Multimodal, Video & 3D
  10. ↻ Reinforcement Learning
  11. ⚙ ML Development & MLOps
  12. ★ Advanced & Frontier Topics
Learn/ML Development & MLOps

The ML lifecycle & MLOps maturity

From problem framing to data, training, evaluation, deployment and monitoring — why it is a loop, why baselines come first, where technical debt hides, and Google's MLOps levels 0–2.

Intermediate~18 min·5 references
Key terms
MLOpsBaselineModel monitoringData driftCI/CDA/B testingEvals

Training a model in a notebook is maybe 10% of the work. The rest is deciding what to predict and why, getting trustworthy data, proving the model is better than something simple, shipping it safely, and noticing when it silently gets worse. MLOps is the set of practices that makes this whole loop repeatable and automated[3][4].

≈
Cooking one dinner vs. running a restaurant
Cooking one great dinner at home is like training one good model. Running a restaurant means the same dish must come out right every day, with new suppliers, changing tastes, health inspections and a way to fix a bad batch fast. MLOps is running the restaurant.

The loop, stage by stage

  1. Problem framing — the business goal, the prediction target, how a prediction becomes an action, and what “good enough” means (metric + target value + cost of errors).
  2. Data — collection, labelling, cleaning, validation, splitting into train/validation/test and versioning.
  3. Training & experimentation — feature engineering, model selection, Hyperparameter tuning, all logged with Experiment tracking.
  4. Evaluation — offline metrics against a Baseline, slice analysis (per segment), fairness and robustness checks, then online tests such as A/B testing.
  5. Deployment — packaging, Model serving (batch or online), gradual rollout (shadow, canary).
  6. Monitoring — system health, Data drift, prediction quality once labels arrive. Findings feed back into step 1 or 2: the loop closes.
Loading interactive…
The whole loop on one canvas. Press Walk through to go stage by stage, or tap a box (e.g. Evaluation or Retrain trigger) to see what happens there. Notice the dashed arrow: monitoring feeds fresh data back in, so the work never really ends — MLOps is about making that loop automatic.

Framing: tie the ML metric to a business metric

Product goalML task & offline metricOnline / business metric
Reduce customer churnBinary classification; PR-AUC, recall@top-10%Retention rate of contacted customers
Faster support repliesTicket routing (multi-class); macro-F1Median time to resolution
Better delivery ETAsRegression; MAE in minutesLate-delivery complaints
LLM support assistantTask-specific Evals (answer correctness, groundedness)Deflection rate, CSAT

Baselines first — and maybe no ML at all

Google's *Rules of Machine Learning* open with Rule #1: “Don't be afraid to launch a product without machine learning” and Rule #4: “Keep the first model simple and get the infrastructure right”[1]. A Baseline — a heuristic, the majority class, last week's value, or a logistic regression — tells you whether a fancy model is worth its complexity, and it tests your whole pipeline end to end.

python
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.model_selection import cross_val_score

for name, clf in [
    ("majority class", DummyClassifier(strategy="most_frequent")),
    ("logistic reg.", LogisticRegression(max_iter=1000)),
    ("grad. boosting", HistGradientBoostingClassifier()),
]:
    s = cross_val_score(clf, X, y, cv=5, scoring="average_precision")
    print(f"{name:15s} PR-AUC = {s.mean():.3f} ± {s.std():.3f}")
Always compare against a dummy and a simple model

Where the real cost hides: technical debt

Sculley et al. showed that in real ML systems only a small fraction of the code is the model; most is configuration, data collection, feature extraction, verification, serving and monitoring[2]. They name typical debts: CACE (“Changing Anything Changes Everything” — features are entangled), glue code and pipeline jungles, undeclared consumers of a model's outputs, hidden feedback loops (the model influences the data it is later trained on), and configuration debt.

MLOps maturity levels (Google Cloud)

LevelWhat it looks likeMain risk / benefit
0 — Manual processNotebooks, manual hand-off of a model file to engineers, rare releases, no monitoringModels go stale; hard to reproduce
1 — ML pipeline automationThe training pipeline itself is deployed; continuous training (CT) on new data or triggers; data & model validation; metadata storeFresh models automatically; pipeline changes still manual
2 — CI/CD pipeline automationPipeline code itself is built, tested and deployed by CI/CD; many experiments shipped quickly and safelyFast iteration at scale; higher setup cost
Summarised from Google Cloud's “MLOps: Continuous delivery and automation pipelines in machine learning”[3].
knobtrain / validation / test split ratio
What it is
How much labelled data goes to fitting, to model selection, and to the final untouched estimate.
↑ If you increase it
A larger validation/test share gives tighter, more trustworthy metric estimates but leaves less data to learn from.
↓ If you decrease it
A tiny validation/test set makes metrics noisy — differences of 1–2% may be pure chance.
Typical values
70/15/15 or 80/10/10 for medium data; time-based splits for anything that evolves over time.
knoblaunch criterion (quality gate)
What it is
The pre-agreed bar a new model must pass to replace the current one, e.g. “PR-AUC ≥ champion + 0.01 and no slice drops more than 2 points”.
↑ If you increase it
A stricter gate prevents regressions but may block genuine small improvements and slow iteration.
↓ If you decrease it
A looser gate ships faster but lets noisy “improvements” (or slice regressions) reach users.
Typical values
Beat the champion by more than the metric's run-to-run noise; check key slices separately.
knobcanary traffic share
What it is
Percentage of live traffic routed to a new model version during a gradual rollout.
↑ If you increase it
More traffic gives statistically clearer signals sooner, but more users are exposed if the model is bad.
↓ If you decrease it
Less exposure (safer), but you must wait longer to collect enough evidence.
Typical values
1–5% → 25% → 50% → 100% in steps.
knobA/B test duration / sample size
What it is
How long (how many users or events) an online experiment runs before deciding.
↑ If you increase it
Detects smaller effects and averages out weekday/weekend cycles; costs time and keeps users on the worse variant longer.
↓ If you decrease it
Fast decisions but high risk of false positives, especially if you “peek” and stop as soon as results look good.
Typical values
Compute the sample size from the minimum effect you care about; run at least one full weekly cycle.
!
Lifecycle pitfalls
• Optimising an offline metric nobody linked to the business goal. • Skipping the baseline, so a complex model “wins” against nothing. • Random splits on time-dependent data → leakage from the future. • Treating deployment as the finish line — without monitoring, decay is invisible. • Feedback loops: a recommender trained on clicks it caused itself.
▸Go deeper: roles and principles in MLOps

Kreuzberger et al. surveyed the field and distilled MLOps into principles — CI/CD automation, workflow orchestration, reproducibility, versioning of data/model/code, collaboration, continuous training & evaluation, metadata tracking, continuous monitoring and feedback loops — and roles such as data scientist, data engineer, ML engineer/MLOps engineer, DevOps engineer and software engineer[4]. Huyen's book treats the same lifecycle from a systems-design angle, with many examples of data distribution shifts and deployment trade-offs[5].

Quiz

1.
According to Sculley et al., what is usually the largest part of a production ML system's code?
2.
A team retrains automatically every week when new data lands, with data validation, but changes to the pipeline code are deployed by hand. Which Google MLOps level is this?
3.
Why train a DummyClassifier before anything else?
4.
What happens if you shrink the canary traffic share from 10% to 1%?
5.
A recommender is retrained on clicks from items it chose to show. Which hidden debt is this?
Score: 0/5

References

  1. [1]
    Rules of Machine Learning: Best Practices for ML Engineering
    ArticleZinkevichdevelopers.google.com
  2. [2]
    Hidden Technical Debt in Machine Learning Systems
    PaperSculley et al.2015papers.nips.cc
  3. [3]
    MLOps: Continuous delivery and automation pipelines in machine learning
    ArticleGoogle Clouddocs.cloud.google.com
  4. [4]
    Machine Learning Operations (MLOps): Overview, Definition, and Architecture
    PaperKreuzberger et al.2022arxiv.org
  5. [5]
    Designing Machine Learning Systems
    BookChip Huyen2022oreilly.com
← Previous
The ML development stack
Next →
Experiment tracking with MLflow