Data and Features in Production
Who it is for
What you will achieve
Prerequisites
Curriculum
- Step 1: Time Splits and Group Splits: Make the Split Match How the Model Is Used
One model on Rain in Australia, scored after a random split, a time split and a group split by town. The gaps are small here, but the spread across towns is wide, and the split you pick decides what the score means.
- Step 2: Time Series Basics: Lags, Rolling Windows and Walk-Forward Backtesting
Forecast tomorrow's maximum temperature in Sydney from past temperatures only: fill the calendar with asfreq, build lag and rolling features with shift, beat the same-as-today guess, and backtest over five walk-forward folds.
- Step 3: Feature Engineering Patterns, Each One Tested: Date Parts, Differences, Windows and Target Encoding
Four feature patterns on Rain in Australia, each scored against one baseline on a time split: month, pressure change, a 7-day rain window and a location rain rate. Small honest gains, and two leaks that beat them all.
- Step 4: Point-in-Time Correctness: Join Features as of Each Event with merge_asof
A feature may only use what was known at the moment of the prediction. Create the leak with a plain merge of today's balance, fix it with pandas merge_asof, and compare the two tables and their scores on synthetic payment data.
- Step 5: Data Validation and Schema Checks: Stop Bad Input Before It Reaches the Model
Send messy input to a car price API and it still answers, with a wrong price. Add a Pydantic schema that refuses impossible values with a 422, a four-rule batch check before training, and see why a valid value can still be wrong.
- Step 6: Training-Serving Skew: Same Model, Different Inputs, and How to Detect It
Offline the model is great, live it gets worse, and nothing crashes. What training-serving skew is, the three usual causes, how it differs from drift, and how to detect it, test the alert and roll back.
- Step 7: Feature Stores: Offline and Online Stores, and When You Actually Need One
Two pipelines, two definitions of the same feature, and a model that gets a number it never learned from. How one feature definition, an offline store and an online store fix that, and the honest signs that you need one.
- Step 8: Data Versioning with DVC: Tie Every Model to the Exact Data That Trained It
Version data the way Git versions code. Add a car price CSV and a model with DVC, change one price, go back with git checkout and dvc checkout, get the same RMSE again, and trace a model back to the data that trained it.