Machine Learning Engineering

How do I turn data into a reliable machine learning system that learns useful patterns, generalises correctly, serves predictions in production, and remains measurable, reproducible and maintainable over time? Not a scikit-learn recipe book, not a PyTorch notebook, not a catalogue of algorithms.

The question this domain answers

A model is a set of assumptions with weights attached.

The weights are the easy part. What decides whether the system works is everything around them: what the target means, how the dataset was built, whether information from the answer leaked into the features, which metric maps to the business cost, what threshold turns a probability into a decision, whether serving computes the same features training did, and what happens when the world the model learned from changes. A learner who finishes this hears “accuracy is 94%” and does not nod. They ask on what dataset, split how, against which baseline, at which threshold — and what must stay true for that number to keep meaning anything.

The reasoning loop every lesson carries
ProblemTargetDataRepresentationSplitModelTrainingEvaluationValidationDeploymentInferenceMonitoringDriftRetraining

The order is the argument. The decision decides the target; the target decides what data and what label; the data decides the split; the split decides whether the evaluation means anything; and everything after deployment is a check on whether those decisions still hold. Start in the middle — pick a model, tune it, report a number — and you get a result that is locally impressive and disconnected from anything that has to be true.

This is the model domain

Machine Learning Engineering does not own every layer it touches. It owns training, evaluation, serving and operating predictive models — and deep-links its neighbours rather than re-teaching them.

Upstream

Data Engineering collects, moves, transforms, validates and serves the data — the feature pipelines, the point-in-time joins, the stream the model scores. Cloud and Computer Architecture provide the compute and explain why a GPU idles on a small batch.

Here

Problem formulation, targets and labels, datasets and splits, leakage, features, models and how they learn, metrics that map to costs, evaluation that survives production, artifacts, inference, serving, monitoring, drift, retraining, and the MLOps practices that make all of it reproducible. No other domain answers what must stay true after deployment.

Downstream

Backend exposes the model through an API, DevOps rolls it out, Observability measures it, Security defends it, and Agentic Engineering builds LLM and agent systems on top of it — prompting, retrieval, tools, memory and agent evals live there, not here.

This domain's characteristic failure is certainty produced by a number. A validation AUC is a statement about one dataset, one split and one point in time, and it is repeated as if it were a property of the model. So every claim here carries a scope label saying what it is specific to — the task, the data, the model family, the scale, the business domain — and every illustrative number is labelled SIMULATED or SIMPLIFIED. Where practitioners genuinely disagree — retraining cadence, feature stores, calibration versus thresholding — the lesson is labelled CONTESTED and states the strongest form of the other side.

Flagship experiences

The parts of this domain that are not reading. Every number on these pages comes from a real computation on synthetic data — a model actually trained, a tree actually grown — never a table pretending to be a run.

The ML Pipeline →

Raw data to feedback in eleven stages — then ask "what can go wrong?" and see the sixteen failure classes appear at the stage each one enters. Most of them are invisible offline.

Follow One Prediction →

A user opens the product. Trace the request through the frontend, backend, feature retrieval, transformation, model server, artifact, GPU, prediction, threshold, action, outcome and the future training set — with "go one layer deeper" at every stage.

Leakage Simulator →

A real logistic regression, trained by gradient descent on synthetic churn data. Inject a future timestamp, a target-derived feature, the same user in train and test, or global normalisation — and watch validation AUC beat the honest future-period AUC.

Threshold Explorer →

Slide the threshold and watch precision, recall, F1, the confusion matrix and the business cost move. Includes calibration, and the reason 99.9% accuracy on 0.1% fraud means nothing.

Bias / Variance Explorer →

Polynomials actually fitted to noisy data: training error falls with degree, validation error is U-shaped, and more data narrows the gap.

Gradient Descent Visualizer →

SGD, momentum and Adam on three loss surfaces, with a learning rate you can push until it diverges. No optimizer wins everywhere, and the lab shows where each loses.

Backpropagation Visualizer →

A 2-2-1 network as a computational graph: forward values and backward gradients on every node, one training step at a time, gradients checked against finite differences.

Decision Tree Visualizer →

Grow a CART tree on 2D data one level at a time and watch training accuracy rise while held-out accuracy peaks and falls.

Embedding Explorer →

Vectors projected to 2D with the warning made concrete: the neighbours the plot shows are not the neighbours the model sees, and the lab measures the disagreement.

Drift Explorer →

Six scenarios over twelve weeks with labels arriving three weeks late. Some need retraining. Some are a pipeline bug. One is drift with no quality loss at all — and retraining would be the mistake.

ML Failure Simulator →

Ten controls — add leakage, corrupt labels, shift a feature, delay labels, kill the model server, traffic spike — and nine monitoring signals. Read the signals, name the cause, then see whether the readings alone could have told you.

Inference Decision Tool →

Freshness, precomputability, live features, latency budget and volume decide batch, online, streaming or hybrid — with reasons, alternatives and what each costs.

Problem Formulation Lab →

The questions to answer before choosing a model, worked for subscription churn, with what goes wrong when each one is skipped.

What ML Approach Should I Consider? →

Three decision trees — approach, offline-good-production-bad, should-we-retrain. Every leaf names why, the trade-off, the simpler baseline to try first, and how the approach itself fails.

Capstone: churn system, recommendation system →

Build a churn-prediction system from CSV to production, then absorb eight injected failures — none of which is fixed by retraining. Then a recommendation system with a feedback loop.

Practice challenges →

Four levels, with the cause unlabelled. Each one carries the trap: the fix that looks right — usually "retrain it" — and leaves the real problem in place.

Interview guide →

What each question is really testing, what a strong answer sounds like, and the red flags that separate a recited algorithm from a working model of the system.

Learning modules

Thirty-nine modules, from what one training example represents to designing a fraud system whose labels arrive ninety days late.

236 lessons →
ML Fundamentals6

What a machine learning system actually is — a pipeline from raw data to feedback — and the sixteen things that go wrong in it, most of which are invisible offline.

Problem Formulation7

Start from the decision, not the model. What event to predict, when the prediction must exist, what action follows, what each mistake costs, and whether labels can be observed at all.

Learning Paradigms6

Supervised, unsupervised, semi-supervised and self-supervised — distinguished by where the learning signal comes from, and by what each can and cannot promise.

Task Types6

Regression, classification, ranking, clustering, dimensionality reduction and anomaly detection — what each one outputs, and why a visually separated cluster is not a business segment.

Dataset Construction7

Filtering, joining, labelling and feature creation each introduce bias or leakage. What one training example represents, and how sampling decides what the model can learn.

Data Splitting6

Train, validation and test as three different jobs, and the split strategy — random, temporal, grouped, stratified — as the decision that decides whether the metric means anything.

Data Leakage7

The deepest module. Target, temporal, entity, preprocessing, feature and evaluation leakage: every way information from the answer reaches the model, and why each makes offline metrics lie.

Feature Engineering7

Aggregation, bucketing, normalisation, encoding, temporal and interaction features — each a transformation that must be reproduced identically at serving time.

Representation & Importance5

Hand-engineered features against learned representations, feature selection, and importance methods — with the warning every one of them needs: importance is not causality.

Baselines5

Rule, mean predictor, majority class, linear model, simple tree. Mandatory before anything complex, because a model that does not beat a useful baseline has not earned its cost.

Linear Models6

Linear and logistic regression as the models everything else is compared to: coefficients, residuals, the sigmoid, and the threshold that turns a probability into a decision.

Classification Metrics7

The confusion matrix and everything derived from it — precision, recall, F1, ROC AUC, PR AUC, calibration — each with its business reading and the case where it misleads.

Regression Metrics4

MSE, RMSE, MAE, R² and the caveats on MAPE: what each punishes, what each hides, and how to choose one from the cost of being wrong.

Evaluation7

Business metrics against model metrics, offline against online, cross-validation and its temporal variant, slices — and the rule that the test set is touched once.

Bias, Variance & Generalisation6

Underfitting, overfitting, learning curves, regularisation and early stopping — the mechanics of why a model that memorised the training set looks perfect until it meets new data.

Trees & Ensembles6

Decision trees, random forests and gradient boosting — how each learns, why boosting fits residuals, and XGBoost and LightGBM as implementations rather than as answers.

k-NN, Naive Bayes & SVM4

Three mental models, their assumptions, strengths and limits — taught as ways of thinking about data rather than as API calls.

Neural Networks7

The neuron, activations, the forward pass, loss functions and backpropagation on a computational graph — the mechanism every deep learning framework hides.

Optimisation7

Gradient descent, SGD, momentum and Adam; epochs, batches and steps; learning rate and batch size trade-offs; vanishing and exploding gradients; normalisation.

Embeddings5

Discrete entities as dense vectors — words, users, products, documents — cosine similarity, and why a 2D projection distorts the geometry it claims to show.

Architectures5

Convolutions for spatial structure, recurrent models for sequences, and transformers: tokens, embeddings, self-attention, positional information.

Foundation Models & Fine-Tuning5

Encoder and decoder families, pretrained models reused across tasks, transfer learning, fine-tuning and parameter-efficient adaptation — at the level of what changes and what it costs.

Hyperparameter Tuning5

Hyperparameters against learned parameters; grid, random and Bayesian search; the budget; and the rule that nothing is ever tuned on the test set.

Time Series5

Forecasting, trend and seasonality, horizon, anomaly detection — and validation that respects time, because a random split on temporal data is leakage.

Recommendation Systems7

Candidate generation and ranking, collaborative and content-based filtering, cold start — and feedback loops, where the model changes the data it will be trained on next.

Experiments & Reproducibility6

What every run must record, why random seeds alone do not reproduce anything, and versioning datasets, labels, features and models so lineage can be traced.

Artifacts & Registry5

What a model artifact contains, the registry lifecycle from candidate to archived, and promotion judged on quality, latency, memory, cost and robustness rather than one offline score.

Inference Modes7

Batch, online and streaming inference, how to choose between them from freshness, latency and volume, the serving architecture, batching, and CPU against GPU.

Serving & Train/Serve Skew7

Identical weights can fail if the features differ. Skew, feature stores as optional infrastructure, point-in-time correctness, freshness, latency breakdown and fallbacks.

GPUs & Efficiency6

Parallel compute, matrix operations, memory bandwidth and VRAM; quantization from FP32 to INT8; pruning and distillation; and what inference actually costs.

Distributed Training6

Data, model, tensor and pipeline parallelism, gradient synchronisation with all-reduce, checkpointing for recovery, and the cost of a training run.

ML Testing7

A dedicated stack: data and feature tests, training smoke tests, model invariants, serving contracts, robustness — because a green unit test suite says nothing about a model.

Fairness, Explainability & Causality5

Subgroup performance with no universal fairness metric, explanations that are approximate, privacy as design, and the line between predicting Y and causing it.

Monitoring & Drift8

Data, feature, prediction and concept drift taught separately; drift that is not failure; ground truth that arrives weeks late; and performance decay diagnosed rather than assumed.

Retraining & Rollout7

Retraining as a decision rather than a schedule, champion/challenger, shadow, canary, A/B — and rollback and fallback, which every serving system needs before it needs a second model.

ML Observability5

Tracing one request through features, model version, prediction, decision and outcome; logging what is necessary and safe; and debugging an incident from the business metric down.

MLOps & Platforms7

The practices that make ML reproducible, testable, deployable and observable — CI, CT and CD distinguished, platform capabilities, cloud primitives before vendors, cost.

ML Security5

Poisoning, artifact integrity, sensitive-data leakage, adversarial inputs, supply chain and inference abuse — defensively, and at the level of what to validate and trust.

ML System Design7

The questions to ask before drawing boxes, then recommendation, fraud, churn and search ranking designed end to end — and the boundary with Agentic Engineering.

Reference

For when you already know roughly what you are looking for.

Don't delegate understanding

The point of the domain, stated plainly.

Libraries
hide optimisation
AutoML
hides search
Feature stores
hide synchronisation
Model servers
hide inference
Cloud ML platforms
hide infrastructure
Foundation models
hide enormous training systems

Use all of them. Rebuilding them by hand is not the lesson. But understand what data the model learned from, what objective it optimised, what assumptions it depends on, and what happens when those assumptions stop being true — because when one of these abstractions leaks, and each leaks in a characteristic way, you want to be debugging a system you have a model of rather than one you have been trusting.