Handbook: applied machine learning as reliable software

An original text written alongside the labs. Each section is meant to be sufficient to start learning without another book; external sources are for verification and optional depth.

Every section has the same parts: overview, deeper explanation with examples, relevant equations, practical decisions and tradeoffs, common failure modes, quick reference, sources and verification status. Section ids (H2.1) are stable and are what lessons link to.

Chapter Sections
1. Practical ML problem formulation H1.1 From stakeholder need to prediction target
H1.2 Units, labels, costs and constraints
2. Maintainable Python for ML H2.1 Project structure and environments
H2.2 Configuration, logging and reproducible runs
H2.3 Git workflow, linting and refactoring discipline
3. SQL and data pipelines H3.1 Grain, joins, aggregation and NULLs
H3.2 Window functions and time-series SQL
H3.3 Ingestion and schemas
H3.4 Deterministic feature pipelines
4. Data quality and exploratory analysis H4.1 Quality checks as code; exploratory analysis that changes decisions
5. Classical ML and strong baselines H5.1 Trivial and linear baselines
H5.2 Metrics from decisions
H5.3 Trees, ensembles and isolation forests
H5.4 Complexity versus evidence
6. Evaluation, leakage and uncertainty H6.1 Leakage: a taxonomy, detection probes and prevention by construction
H6.2 Thresholds, imbalance and calibration
H6.3 Group-aware and temporal validation
H6.4 Selection and nested validation
H6.5 Point-level versus event-level evaluation
H6.6 Bootstrap and paired comparisons
H6.7 Error analysis
7. Time-series and grouped-data modelling H7.1 Windowing and causality
H7.2 Purging and embargo: buffers for windowed data
H7.3 Event matching
H7.4 Forecast-residual detection
H7.5 Multivariate detectors: PCA, Hotelling’s T² and Q
H7.6 Neural sequence models, fairly compared
8. Reproducible experiments H8.1 Run registries and sweeps
H8.2 Seeds and variance
H8.3 Clean-clone reproduction
9. Testing ML systems H9.1 Unit testing ML code
H9.2 API, integration and contract tests
10. Batch and online inference H10.1 One pipeline for training and serving
H10.2 Model artifacts and versioning
H10.3 Stateful online inference
H10.4 Latency and throughput
11. FastAPI and input validation H11.1 HTTP for ML engineers
H11.2 Schemas and validation
H11.3 Lifecycle and concurrency in a prediction service
12. Docker and reproducible environments H12.1 Images, layers and Dockerfiles
H12.2 Pinning, multi-stage builds and smoke tests
13. One cloud deployment path H13.1 Identity, credentials and cost
H13.2 Registry and a container service on AWS
14. CI/CD fundamentals H14.1 Continuous integration
H14.2 Delivery, promotion and rollback
15. Logging, monitoring and model updates H15.1 Service logs and metrics
H15.2 Operational debugging
H15.3 Input monitoring and drift statistics
H15.4 Drift versus degradation, delayed labels
H15.5 Updates and rollback
H15.6 Reliability patterns for ML services
16. ML system design and technical communication H16.1 Decision memos
H16.2 Reports and limitations
H16.3 System design structure
H16.4 Interview problem patterns

Reading alongside the 12-week course

The lessons teach the essentials; these chapters go deeper. Read them after the week, when a lesson’s “Going further” points there, or when something did not quite land.

The handbook was first written for the advanced track, so some examples use its project (flowguard) and session ids such as w3d4.

All 55 sections are written. Each ends with its sources and verification status; most were checked against official documentation sources, and anything written from memory is labelled there.

Bridges between domains

A recurring device in this handbook is to restate an idea from one field (here, biomedical signals such as EEG, where many of these problems were met first) in another domain, and to say where the analogy breaks. You do not need any EEG background: each row reads as “the same structure in two settings”.

In biomedical-signal work Same structure elsewhere Where the analogy breaks
Subject-wise splits; cross-patient generalisation Machine-, customer-, store- or site-wise splits Business groups are often open-ended and changing; new groups appear daily
Line length, band power, RMS on signal windows (e.g. EEG) Vibration and current features in equipment monitoring Sampling rates, sensor bandwidth and physics-based fault frequencies differ
Seizure or other event detection scored by event overlap and latency Fault-event detection scored by event recall and detection delay Industrial events are rarer and labels come from maintenance logs with delays
Non-stationarity across sessions, electrode drift Sensor recalibration, seasonal demand, product changes Drift may be intentional (a price change) and documented outside the data
Artefact rejection Data-quality rules and input validation at the API boundary Rejection must be automatic, logged and reversible in production
Real-time brain-computer-interface loop latency Online inference latency budgets (p95/p99) Budgets are contractual; failures need fallbacks rather than a restarted session

Table of contents


Back to top

Applied ML Engineering course materials. Code is MIT licensed; prose is CC BY 4.0. The SKAB dataset is GPL-3.0 and is downloaded from its source, not redistributed here.