Addaly is in open beta. Things will change, and AI answers can be wrong — check anything that matters.

Machine Learning, Foundations

The classical ground under modern AI, for someone who can read code.

Machine Learning, Foundations

The classical ground under modern AI, for someone who can read code.

Level
Some background helps
Lessons
92
Reading time
796 min
Price
Free, no sign-up to read

How a machine actually learns from data: what fitting means mechanically, why the features you choose matter more than the algorithm you pick, how to hold out data honestly, why accuracy lies on rare events, what the classic algorithms are good at, and how gradient descent and neural networks follow from all of it. You should be able to read code. You do not need calculus, statistics, or a maths degree — every idea arrives with real numbers attached.

Opens after the Getting Real Work Out of a Model exam

Sign in, finish that course, and pass its exam. You can read this syllabus meanwhile.

Go to Getting Real Work Out of a Model

Download the textbook (PDF) · free to print and teach from, with the exam paper and every answer at the back.

Module 1

9 lessons · 76 min

What learning is, and what it is not

Before any algorithm, the vocabulary and the honest framing. What a dataset actually is, what a loss function commits you to, what number your model has to beat before anyone should care, and the large class of problems where the correct machine learning solution is not to use machine learning.

By the end you can

Take a vague business question, state it as a dataset with a defined row, a defined target and a defined moment of prediction, name the loss and the baseline it must beat, and justify in one paragraph whether machine learning is the right tool at all

  1. 1What a machine actually learnsLocked — this takes you to what opens it. 8 minLearning means adjusting the parameters of a shape you chose until a chosen error number is as small as it can be.
  2. 2With answers, and withoutLocked — this takes you to what opens it. 7 minA supervised model learns your labels, not the reality behind them, so who made the labels is part of the model.
  3. 3What a row is, and why that decision is the whole projectLocked — this takes you to what opens it. 9 minDecide what one row is and when the target becomes knowable before you write any code, because every split, metric and deployment decision inherits that choice silently.
  4. 4The loss is where you state what a mistake costsLocked — this takes you to what opens it. 9 minSquared error fits the mean and fears outliers, absolute error fits the median and ignores them, log loss punishes confident mistakes without limit — and none of these is the metric you report.
  5. 5The number your model has to beat before anyone should careLocked — this takes you to what opens it. 8 minCompute the constant, persistence and existing-rule baselines before training, and report the gap between baseline and model rather than the model's score alone.
  6. 6Why a model that predicts well cannot tell you what to changeLocked — this takes you to what opens it. 9 minA predictive model reports associations that hold when you leave the world alone; changing something requires an experiment or an explicit causal assumption, and no accuracy score can substitute for either.
  7. 7The problems where the right answer is a ruleLocked — this takes you to what opens it. 8 minMachine learning earns its cost only when the decision rule is real but unwritable; when the rule is known, exact, or the data is too thin to tell a good model from a lucky one, code the rule.
  8. 8The whole loop, once, before we slow downLocked — this takes you to what opens it. 10 minThe whole discipline is nine steps with one irreversible arrow: the test set is touched once, at the end, after every decision has been made without it.
  9. 9A working setup that costs nothingLocked — this takes you to what opens it. 8 minThe standard toolchain for classical machine learning is free and open source; the ceiling on free compute constrains pretraining large models, not the tabular work that most jobs consist of.

Module 2

10 lessons · 86 min

Linear models and the machinery of fitting

The simplest useful model, taken seriously. Fit a line by hand, watch an optimiser find the same answer, then extend it to probabilities, to many classes, and to curves — and learn to read the coefficients without believing more than they say.

By the end you can

Fit and diagnose a linear or logistic model end to end: compute its loss by hand on a handful of rows, tune the learning rate from the shape of the loss curve, state what a coefficient does and does not mean in the units of the data, and explain what ridge and lasso penalties change about the fitted parameters

  1. 10Fitting a line to five points, by handLocked — this takes you to what opens it. 9 minFitting means choosing parameter values that make a chosen error number small; the coefficient carries real units, and a linear model will extrapolate far outside its data without any signal that it is guessing.
  2. 11There is an exact answer, and we usually refuse itLocked — this takes you to what opens it. 8 minLinear regression with squared error has an exact one-step solution; gradient descent is taught because it is the only method that still works when the loss or the model has no such formula.
  3. 12Gradient descent, or walking downhill in fogLocked — this takes you to what opens it. 8 minGradient descent only knows the slope where it is standing; the step size decides whether that knowledge helps or destroys it.
  4. 13Batches, epochs, and the two knobs that decide everythingLocked — this takes you to what opens it. 9 minMini-batch size trades gradient noise against step count, and the learning rate must match the scale of the features — which is why standardising inputs fixes more convergence problems than raising the iteration limit.
  5. 14Diagnosing a model from the shape of its loss curveLocked — this takes you to what opens it. 8 minPlot training and validation loss on one axis every run: the gap diagnoses fit, the slope at the end diagnoses training length, and NaN or a flat line diagnoses a bug rather than a modelling problem.
  6. 15Logistic regression, built from odds rather than assumedLocked — this takes you to what opens it. 10 minLogistic regression models the log-odds as a straight line, which is why the sigmoid appears and why a coefficient multiplies the odds by a constant factor rather than shifting the probability by a constant amount.
  7. 16What a coefficient says, and the four ways it liesLocked — this takes you to what opens it. 9 minA coefficient is a change in the target per unit of one feature, holding the others in the model fixed — so it is only comparable when standardised, only stable when features are uncorrelated, and only meaningful relative to the exact set of columns included.
  8. 17Regularisation: paying for large coefficientsLocked — this takes you to what opens it. 9 minRidge and lasso add a price on coefficient size to the loss; lasso reaches exactly zero because the gradient of the absolute value stays constant as the coefficient shrinks, while ridge's push fades away near zero.
  9. 18Making a straight-line model bendLocked — this takes you to what opens it. 8 minA linear model bends by manufacturing columns — squares, interactions, bins, splines — and the interaction terms matter most, because finding those automatically is precisely what tree models do that linear models cannot.
  10. 19More than two classes, and what changesLocked — this takes you to what opens it. 8 minSoftmax makes classes compete for a fixed probability budget, which is correct when exactly one label is true and wrong for multi-label problems, where independent sigmoids with their own thresholds are needed.

Module 3

12 lessons · 105 min

The data is the job

The part of machine learning that takes most of the time and wins most of the accuracy. Numbers, categories, missing values, dates and text turned into columns a model can use — and the two failures that quietly destroy more projects than any modelling mistake: leakage, and a sample that does not represent what you will predict on.

By the end you can

Take a raw table with mixed types, missing values, high-cardinality categories, dates and free text, and produce a fitted preprocessing pipeline that leaks nothing from the held-out data, handles categories unseen at training time, and whose every transformation you can justify by what the downstream model requires

  1. 20Features beat modelsLocked — this takes you to what opens it. 9 minAsk of every feature: at the moment I need the prediction, does this value already exist with this value?
  2. 21Scaling, and the transforms that change what a model can seeLocked — this takes you to what opens it. 9 minScaling is required by distance-based, penalised and gradient-fitted models and irrelevant to trees; the log transform is not cosmetic but a claim that ratios matter more than differences.
  3. 22Turning categories into numbers without lying about themLocked — this takes you to what opens it. 9 minOne-hot is the safe default because it asserts nothing about order or distance; target encoding is powerful and leaks unless computed out-of-fold and smoothed towards the base rate.
  4. 23When a column has thousands of levelsLocked — this takes you to what opens it. 8 minHigh-cardinality columns need a fixed-size representation — grouping, counting, hashing or a learned embedding — and any identifier that will not exist for an unseen row is not a feature at all.
  5. 24Missing values, and the information in the gapLocked — this takes you to what opens it. 9 minAdd a missingness indicator before imputing, because the fact that a value is absent is frequently more predictive than the value would have been — and let boosted trees learn their own direction for NaN rather than imputing at all.
  6. 25Outliers: error, extreme, or the thing you are looking forLocked — this takes you to what opens it. 8 minDecide first whether an extreme value is an error, a genuine rarity, or the target itself, because the same removal step is correct in the first case, harmful in the second, and destroys the problem in the third.
  7. 26Dates, durations, and the trouble with midnightLocked — this takes you to what opens it. 8 minDecompose timestamps into durations and cyclical components, use local time for behavioural features, and shift any rolling window by one period so it cannot include the value you are predicting.
  8. 27Text as columns: counting words before you embed themLocked — this takes you to what opens it. 9 minTF-IDF over word and bigram counts with a linear model is a strong, fast, fully interpretable text baseline; its ceiling is that it cannot represent word order or word similarity, which is precisely what embeddings add.
  9. 28Leakage: a catalogue of the ways the answer gets inLocked — this takes you to what opens it. 10 minLeakage is any feature whose training value would not be available in that form at prediction time, and the reliable test is to reconstruct a row using only information timestamped before the moment of prediction.
  10. 29Fit on train, transform everywhere: the contract that keeps you honestLocked — this takes you to what opens it. 8 minEvery transformation that learns a parameter must learn it inside each cross-validation fold, which is why a Pipeline changes the score you get rather than merely tidying the code.
  11. 30Where the rows came from, and who is missingLocked — this takes you to what opens it. 9 minA held-out set cannot detect a sample that misrepresents the population, because it is drawn from the same sample — so the composition of the data must be reasoned about from how it was collected, not measured from within it.
  12. 31When one class is 0.3% of the dataLocked — this takes you to what opens it. 9 minImbalance usually breaks the decision threshold rather than the model, so move the threshold and change the metric before resampling — and resample only inside the cross-validation fold, never before the split.

Module 4

10 lessons · 85 min

Generalisation, and the discipline of held-out data

Why a model that fits your data is not yet a model that works, and the machinery for finding out: cross-validation, splits that respect the structure of the data, learning curves that tell you whether more data would help, and an honest account of what happens to a validation set you have used two hundred times.

By the end you can

Design a validation scheme that matches the structure of the data — grouped, stratified or time-ordered as required — run a hyperparameter search inside it without contaminating the estimate, and state from a learning curve whether the next improvement should come from more data, better features or a different model

  1. 32Train, validation, test, and the discipline of not lookingLocked — this takes you to what opens it. 9 minThe test set is a single-use measuring device; every peek turns it into another validation set.
  2. 33Overfitting, underfitting, and how to tellLocked — this takes you to what opens it. 8 minCompare training error with validation error; the gap between them, not the score itself, names the problem.
  3. 34Cross-validation: using every row twice, legallyLocked — this takes you to what opens it. 9 minCross-validation averages several held-out estimates so a score depends less on where the split fell, but the best score from a hyperparameter search is biased upward and needs an outer loop or an untouched test set to correct.
  4. 35Splits that respect the structure of the dataLocked — this takes you to what opens it. 9 minMatch the split to the structure — group by entity, order by time with a gap equal to the label delay, stratify small or imbalanced sets — and verify with a label-shuffle test that a correct pipeline collapses to chance.
  5. 36Bias and variance, with numbers attachedLocked — this takes you to what opens it. 9 minHigh bias is being wrong the same way every time and high variance is being wrong differently every time; the training-validation gap tells you which, and the classical U-shaped curve stops describing very large models.
  6. 37Would more data help? The curve that answers itLocked — this takes you to what opens it. 8 minPlot validation score against training-set size: a curve still climbing means collect more data, a converged pair at a poor score means the features or the model family are the limit, and no learning curve can anticipate a feature you have not built.
  7. 38Searching hyperparameters without fooling yourselfLocked — this takes you to what opens it. 9 minRandom search over log-scaled distributions beats grid search at equal cost because it tries many distinct values of the parameters that matter, and every configuration evaluated adds selection bias that only an untouched test set can measure.
  8. 39A validation set you have used two hundred timesLocked — this takes you to what opens it. 8 minThe best of many noisy validation estimates is biased upward by roughly the standard error times the square root of twice the log of the number of comparisons, so the count of experiments belongs in the report alongside the score.
  9. 40How much data do I need?Locked — this takes you to what opens it. 8 minSize the validation set from the precision you need — the standard error of a proportion at n=1,000 is about 1.1 points — and size the training set by events per feature rather than by total rows.
  10. 41Double descent, and the picture that stopped being completeLocked — this takes you to what opens it. 8 minTest error can fall again past the point where a model fits the training data exactly, because extra capacity gives the optimiser many perfect fits to choose among and gradient descent prefers smooth ones — an observation that is well replicated and not yet fully explained.

Module 5

11 lessons · 97 min

Measuring a model honestly

Everything that turns a fitted model into a decision: the confusion matrix worked by hand, the threshold that nobody should leave at 0.5, curves that summarise every threshold at once, whether the probabilities mean anything, whether an improvement is real, and what fairness can and cannot be made to mean mathematically.

By the end you can

Given a fitted classifier and a stated cost of each kind of error, compute the confusion matrix at a chosen threshold, defend that threshold by expected cost, say whether the model's probabilities are calibrated, decide with an interval whether one model genuinely beats another, and report per-group performance with a defensible fairness criterion and its known trade-offs

  1. 42When accuracy liesLocked — this takes you to what opens it. 9 minChoose the metric that matches what each kind of mistake costs, then set the threshold yourself.
  2. 43The four numbers, worked throughLocked — this takes you to what opens it. 9 minPrecision divides by what the model said and recall by what was true, and precision alone is not a property of the model — it moves with the base rate of the population you run on.
  3. 44The threshold is a business decision, not a defaultLocked — this takes you to what opens it. 9 minThe model produces a score and the threshold converts it into a decision; choose the threshold from the relative cost of the two errors, the capacity to act, or a stated requirement — never from the library default.
  4. 45ROC and precision-recall: every threshold at onceLocked — this takes you to what opens it. 9 minAUC is the probability that a random positive outscores a random negative, so it measures ranking only and is insensitive to a large absolute number of false positives when negatives vastly outnumber positives — which is why imbalanced problems should be reported with average precision.
  5. 46Does 0.7 mean seventy per cent?Locked — this takes you to what opens it. 9 minCalibration asks whether a predicted 0.7 corresponds to 70% of cases occurring, is separate from ranking quality, and is fixed by a monotonic post-processing step that leaves AUC unchanged.
  6. 47Metrics for a number, and what each one hidesLocked — this takes you to what opens it. 8 minReport MAE and RMSE together because their gap measures how uneven the errors are, and plot residuals against predictions — the shape of the failure carries information no summary metric retains.
  7. 48Is that improvement real?Locked — this takes you to what opens it. 9 minBootstrap the difference between two models on the same resampled rows and report the interval; a t-test across cross-validation folds violates independence and declares significance far too often.
  8. 49From a probability to a decision worth makingLocked — this takes you to what opens it. 8 minThe break-even threshold is the cost of a false positive divided by the sum of both error costs, it can and usually should be computed per row from that row's stakes, and the arithmetic is only valid for whoever's costs were put into it.
  9. 50Fairness as arithmetic: the definitions and what each one demandsLocked — this takes you to what opens it. 10 minDemographic parity, equalised odds and within-group calibration are three precise and different demands, dropping the protected column removes your ability to measure disparity without removing the disparity, and every one of these criteria is silent about bias already inside the labels.
  10. 51Why you cannot have all threeLocked — this takes you to what opens it. 8 minWhen two groups have different base rates, calibration within groups and equal error rates across groups are mathematically incompatible, so fairness requires an explicit and documented choice of which to satisfy.
  11. 52The average is hiding the failureLocked — this takes you to what opens it. 9 minA headline metric is a weighted average that hides its worst population, so slice by every dimension you can name, read fifty errors by hand to find the causes, and turn each failure mode into a fixed test set that runs on every change.

Module 6

10 lessons · 89 min

Trees, ensembles, and the algorithms that win on tables

The family that actually wins most tabular problems, taken apart. How a single split is chosen, why averaging many deep trees works and why adding many shallow ones works for the opposite reason, the handful of hyperparameters that matter in the boosting libraries, and the two older algorithms still worth knowing — plus an honest account of what a feature importance number does and does not tell you.

By the end you can

Choose between a linear model, a random forest and a gradient boosting library for a given tabular problem and defend the choice, tune the four hyperparameters that actually matter in each, and explain why impurity-based feature importance is biased and what permutation importance and SHAP replace it with

  1. 53The classic algorithms, and when each is rightLocked — this takes you to what opens it. 10 minOn tabular data, use linear models as a floor and gradient boosting as the answer; everything else needs a stated reason.
  2. 54How a tree chooses where to cutLocked — this takes you to what opens it. 9 minA tree scores every candidate threshold by the weighted drop in impurity and takes the best one greedily, which gives it interactions for free but leaves it unable to express a diagonal boundary or extrapolate beyond the training range.
  3. 55Bagging: many unstable models, averagedLocked — this takes you to what opens it. 9 minBagging reduces variance by averaging, and a random forest adds per-split feature sampling because decorrelating the trees removes more variance than making each individual tree better.
  4. 56Boosting: each model fixes the last one's mistakesLocked — this takes you to what opens it. 9 minBoosting fits each shallow tree to the residual left by the previous ones and adds only a fraction of it, so accuracy accumulates slowly enough that noise averages out — which is why a boosted model needs early stopping and a forest does not.
  5. 57XGBoost, LightGBM, CatBoost: what actually differsLocked — this takes you to what opens it. 9 minThe three boosting libraries implement the same algorithm with different tree-growth and categorical handling, and six hyperparameters — learning rate, early stopping, depth, minimum leaf evidence, subsampling and L2 — cover essentially all the tuning that matters.
  6. 58k-nearest neighbours, and why distance stops meaning anythingLocked — this takes you to what opens it. 8 mink-NN makes the assumption behind most machine learning explicit — nearby points share targets — and the curse of dimensionality breaks it because distances concentrate, so the nearest neighbour in 1,000 raw dimensions is barely nearer than the farthest.
  7. 59Naive Bayes: wrong assumptions, useful resultsLocked — this takes you to what opens it. 8 minNaive Bayes assumes features are independent given the class, which is false and inflates its probabilities without usually changing which class ranks highest — so it discriminates well while being badly calibrated.
  8. 60Support vector machines and the kernel trickLocked — this takes you to what opens it. 9 minAn SVM maximises the margin and depends only on the support vectors; the kernel trick works because the optimisation needs only pairwise dot products, so an infinite-dimensional feature space costs one similarity computation instead of infinite coordinates.
  9. 61Feature importance, and the ways it misleadsLocked — this takes you to what opens it. 9 minImpurity importance favours high-cardinality features and is computed on training data; permutation importance on validation data measures what you meant, but both collapse when features are correlated, so permute clustered groups rather than single columns.
  10. 62Explaining one prediction, and the shape of one featureLocked — this takes you to what opens it. 9 minSHAP divides one prediction's departure from the average among the features with an exact additive decomposition, partial dependence shows a feature's average learned shape, and both assume feature independence in ways that break when the columns are correlated.

Module 7

10 lessons · 87 min

Learning without labels, and learning a representation

What you can do when nobody has labelled anything: group similar rows, compress many columns into a few, find the rows that do not belong. Then the idea underneath modern search, recommendation and retrieval — an embedding, what it is geometrically, how to get one for free, and how to search a million of them in milliseconds.

By the end you can

Cluster a dataset and defend the number of clusters with more than an elbow plot, reduce dimensionality with PCA and state how much information the reduction discarded, explain what an embedding is as a geometric object, and build a working nearest-neighbour search over pretrained embeddings without a GPU

  1. 63k-means, and what it assumes about your dataLocked — this takes you to what opens it. 9 mink-means minimises within-cluster squared distance, which assumes spherical clusters of similar size with no outliers and a known k, and it will return confident groupings from data that has no group structure at all.
  2. 64Choosing k, and why the elbow rarely helpsLocked — this takes you to what opens it. 8 minThe elbow rarely produces an unambiguous answer; use silhouette per cluster, the gap statistic — which can say that no clustering is right — and stability across subsamples, and accept that the useful k is often set by what the organisation can act on.
  3. 65DBSCAN and hierarchical clustering: when shape and structure matterLocked — this takes you to what opens it. 8 minDBSCAN defines clusters as dense regions, so it finds arbitrary shapes, decides the cluster count itself and labels outliers as noise — at the cost of assuming one density threshold suits the whole dataset, which HDBSCAN removes.
  4. 66PCA: fewer columns, and what you gave upLocked — this takes you to what opens it. 9 minPCA rotates to axes ordered by variance and keeps the first few, which requires standardised features and finds only linear structure — and because it never sees the target, the variance it discards can be the signal you needed.
  5. 67t-SNE and UMAP, and how they misleadLocked — this takes you to what opens it. 8 mint-SNE and UMAP preserve local neighbourhoods and deliberately distort cluster sizes and between-cluster distances, so the only reliable information in the plot is which points are neighbours — and they produce convincing clusters from pure noise.
  6. 68What an embedding actually isLocked — this takes you to what opens it. 10 minAn embedding maps things to vectors so that geometric closeness means similarity in the sense the training task defined, which is why the vectors are compared by angle rather than length and why they carry the training corpus's biases in their geometry.
  7. 69Building a working semantic search with no GPULocked — this takes you to what opens it. 9 minFree CPU-sized embedding models plus an approximate nearest-neighbour index give working semantic search, but chunking affects quality more than model choice and pure embedding search fails on identifiers and negation, which is why production systems combine it with keyword search.
  8. 70Recommendation: learning a vector per user and per itemLocked — this takes you to what opens it. 9 minMatrix factorisation learns a vector per user and per item by fitting only the observed cells, which makes it an embedding trained on interactions — and its recommendations shape the next dataset, so offline metrics are always measured on data the previous model helped create.
  9. 71Anomaly detection, and the base rate that ruins itLocked — this takes you to what opens it. 8 minAnomaly detection models normality instead of learning a boundary, and at a 0.01% base rate even a 1% false positive rate produces a queue that is 99% wrong — so the design work is narrowing the population or ranking, not improving the detector.
  10. 72Self-supervised learning: making labels out of the data itselfLocked — this takes you to what opens it. 9 minSelf-supervised learning manufactures a supervised task from the data's own structure, and the pretext task chosen decides what the representation encodes — which is why a model pretrained with colour augmentation has learned that colour does not matter.

Module 8

10 lessons · 87 min

Neural networks, built from what you already know

A network is a stack of linear models with a bend between them, trained by the same gradient descent from module 2. This module builds it that way: why one layer is not enough, how the chain rule assigns credit backwards, what actually stopped networks working before 2012, and the two architectures — convolution and attention — that carry almost everything you have heard of.

By the end you can

Explain why a multi-layer network with no non-linearity collapses to a single linear model, trace one backpropagation step through a two-layer network by hand, diagnose a training failure from the loss curve and the gradients, and fine-tune a pretrained model on a few hundred labelled examples using free compute

  1. 73Neural networks as the natural next stepLocked — this takes you to what opens it. 9 minA neural network learns its own features; the loss, the splits, the metrics and the thresholds do not change.
  2. 74XOR, and why the bend is the whole ideaLocked — this takes you to what opens it. 8 minA stack of linear layers collapses algebraically into one linear layer, so every capability a network has beyond linear regression comes from the non-linearity applied between the layers.
  3. 75The bends: ReLU, and why sigmoid stopped being used inside networksLocked — this takes you to what opens it. 8 minSigmoid's derivative peaks at 0.25, so backpropagation shrinks the gradient by at least a factor of four per layer and deep networks stopped learning; ReLU's derivative is exactly 1 where it is active, which is why a crude hinge replaced a smooth curve.
  4. 76Backpropagation, traced through one tiny networkLocked — this takes you to what opens it. 10 minBackpropagation multiplies the gradient arriving from above by each operation's local derivative, which computes every weight's gradient in one backward pass — and explains why gradients vanish, why dead ReLUs stop learning, and why training needs far more memory than inference.
  5. 77Starting well, and staying well-behavedLocked — this takes you to what opens it. 9 minInitialisation scale keeps activation variance stable across layers, normalisation keeps it stable across training, and a residual connection gives the gradient an unmultiplied path backwards — which is what made networks deeper than about twenty layers trainable at all.
  6. 78Momentum, Adam, and what the optimiser is doing for youLocked — this takes you to what opens it. 8 minMomentum averages recent gradients so oscillations cancel and consistent directions accumulate; Adam adds a per-parameter step size from the average squared gradient, and its weight decay must be applied outside that scaling, which is what AdamW does.
  7. 79Keeping a large network from memorisingLocked — this takes you to what opens it. 8 minEarly stopping and more data outrank every other regulariser, dropout must be disabled at inference or predictions become random, and before regularising anything you should confirm the network can deliberately memorise twenty examples — otherwise you are tuning around a bug.
  8. 80Convolution: the same detector, everywhere in the imageLocked — this takes you to what opens it. 9 minA convolution applies the same small filter at every position, so it learns a pattern once instead of separately per location — which cuts parameters by orders of magnitude and builds a hierarchy from edges to objects as depth increases.
  9. 81Sequences: from recurrence to attentionLocked — this takes you to what opens it. 9 minAttention lets every position read every other in one step by computing a similarity-weighted average, which removes the multiplication chain that limited recurrent networks and parallelises training — at a cost that grows with the square of the sequence length.
  10. 82Standing on somebody else's computeLocked — this takes you to what opens it. 9 minPretrained early layers encode general structure that transfers across tasks, so start by freezing the backbone and fitting a linear model on its features — and escalate to full fine-tuning only when the measurement says your data supports it.

Module 9

10 lessons · 84 min

Into the world, and keeping it honest

The half of the job that starts when the notebook closes. Serving a model without the training and serving paths drifting apart, monitoring the things that actually fail, deciding when to retrain, making a model small enough to be affordable, and the two obligations that outlast the model: not letting it corrupt its own training data, and documenting who it was built for.

By the end you can

Take a fitted model to a running service with a versioned artefact, a reproducible training run, monitoring that distinguishes covariate shift from concept drift, a stated retraining trigger, and a written record of what the model was trained on and who it should not be used for

  1. 83The model is about 5% of what you have to buildLocked — this takes you to what opens it. 8 minThe model is a small fraction of a production system; the rest is feature computation, versioning, serving, monitoring and rollback — and knowing the serving constraint before choosing a model is what stops you building something that cannot be deployed.
  2. 84Batch, online, and the latency budgetLocked — this takes you to what opens it. 8 minFeature retrieval usually dominates the latency budget rather than model inference, so precompute slow-moving features — and run a new model in shadow mode against real traffic before it serves anyone.
  3. 85When training and serving quietly disagreeLocked — this takes you to what opens it. 9 minTraining-serving skew is a systematic difference between how a feature is computed offline and online, and the reliable defences are shipping one serialised pipeline, importing shared feature code rather than copying it, and an automated test asserting both paths produce identical predictions on the same rows.
  4. 86Monitoring: what to watch, and in what orderLocked — this takes you to what opens it. 9 minMonitor system health, input distributions, prediction distributions and finally actual performance — the first three need no labels and move earlier, and the alert must name which kind of shift it found because covariate, label and concept drift take different remedies.
  5. 87When to retrain, and what breaks when you doLocked — this takes you to what opens it. 8 minRetraining is a deployment and needs the same gates as one, including re-choosing the decision threshold for the new score distribution — and it is the correct remedy only when the relationship has genuinely changed, not for upstream data faults or serving bugs.
  6. 88Being able to build the same model twiceLocked — this takes you to what opens it. 8 minReproducibility requires pinning code, data, environment and seeds together, and because GPU and parallel arithmetic are not bitwise deterministic, the standard to hold is a rerun scoring within noise of the original rather than an identical artefact.
  7. 89AutoML: what it automates, and what it cannotLocked — this takes you to what opens it. 8 minAutoML automates model selection and hyperparameter search — genuinely well, and free — but it cannot frame the problem, build features, detect leakage or choose the metric, which is where most of a model's quality is determined.
  8. 90Making a model small enough to be affordableLocked — this takes you to what opens it. 8 minQuantisation, distillation and pruning trade a small amount of accuracy for large reductions in size and latency — and unstructured pruning reduces parameter count without reducing runtime, which is the distinction most often missed.
  9. 91When the model changes the data it will be trained onLocked — this takes you to what opens it. 9 minA deployed model shapes the data its successor is trained on, so offline metrics measure agreement with the previous model's choices — and only randomised exploration, logged propensities and control groups produce evidence that escapes the loop.
  10. 92What you owe the people in the dataLocked — this takes you to what opens it. 9 minA model card recording the target definition, training population, per-slice performance and out-of-scope uses costs an hour and outlives everyone involved — and the legal questions around copyright, erasure and automated decisions are genuinely unresolved and differ by country.

No ads. No data sale. No public scores on people. Ever.

© 2026 Addaly