CourseAI / ML Engineer: The Complete Course · Module 5: Data Engineering for ML · part 35 of 93
Part 35 · Module 5: Data Engineering for ML

Lesson 4: Features that mean the same in training and serving

25 min read·
Module 5 · Lesson 4 · About 55 minutes · Needs: lessons 1 to 3, Module 3 lesson 3 (leakage and the time-based split), and pandas joins.

The situation

Week 5, Friday. Morag's planners have a hunch: "Some routes are just late. Tell the model which ones." That is a feature, a route's recent late rate. Adaeze's condition is that the number the model trains on is the number it will see at 06:00, computed the same way from data that existed then. Rhys adds that the service will read it from a fast store, not from the lake.

The running example is parcel KP0104204 (simulated) from Module 3: collected at Dartford on Wednesday 2 September 2026 at 18:00, route DAR-R28, late. What did Kestrel know about DAR-R28 at that moment?

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 builds the features and the online store between the lake and the scoring service (blue); the rest of Kestrel 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