CourseAI / ML Engineer: The Complete Course · Module 2: Software and Systems Engineering · part 14 of 93
Part 14 · Module 2: Software and Systems Engineering

Lesson 1: From a notebook to a tested Python package

28 min read·
Module 2 · Lesson 1 · About 50 minutes · Needs: Python functions and pandas, and the Kestrel data (course-guide/06). Module 1 helps but is not required.

The situation

Week 2 at Kestrel, Monday 9 November 2026. Adaeze on the spring prototype: "Nobody can rerun it, and nobody has tested a line of it. Make the feature code something we can install, test and time." Rhys wants to know what features cost per parcel against his p99 of 50 ms (an illustrative target).

The running example is KP0104204 (simulated): collected from Dartford on Wednesday 2 September 2026 at 18:00, next-day service on route DAR-R28.

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 turns Kestrel's feature code into a tested, versioned package (blue); the rest of the 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