CourseAI / ML Engineer: The Complete Course · Module 8: Model Optimisation · part 50 of 93
Part 50 · Module 8: Model Optimisation

Lesson 1: Making models smaller: quantise, prune, distil

29 min read·
Module 8 · Lesson 1 · About 55 minutes · Needs: the MLP and its training loop (Module 4 lesson 1), PR-AUC and the Brier score (Module 3 lesson 3), and the Kestrel data (course-guide/06).

The situation

Week 8 at Kestrel, Monday 21 December 2026. Model v2 is chosen; next week it goes into a scoring service. Rhys wants to know what each candidate model weighs and how fast it answers. Imran wants the cost per prediction. Adaeze sets the rule: "Smaller only counts if the late parcels still come out on top."

One parcel runs through the lesson: KP0104204 (simulated), collected from Dartford on Wednesday 2 September 2026 at 18:00, next-day service, a poor address. It arrived a day late. Every smaller model scores it, and you compare.

WHERE THIS FITS The Kestrel system this lesson SHARED SERVICES Depot scans parcels, routes Ingestion nightly batch Validation Pandera checks Data lake Parquet, DuckDB Experiments MLflow runs Training LightGBM, Optuna Online store Feast, Redis Features point in time Gates vs the champion Registry staged versions Serving API FastAPI, ONNX Consumers vans, customers Retraining trigger, budget Alerting on call Monitoring drift, Evidently Late labels a day later Orchestrator Prefect flows Versions DVC, Git CI/CD GitHub Actions Containers Docker images
This lesson works on the trained model between training and serving (blue); the rest of Kestrel's system is grey for now.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan