Lessons › Chapter 14: ML in practice
Data pipelines
A data pipeline runs the same cleaning steps every time: drop duplicates, fix types, fill or remove missing values. Automated means it’s repeatable, rather than one person’s spreadsheet edits.
Watch it move. This lesson is interactive on Gradient Lab: every step is an animated scene you can replay.
Start the interactive lessonStep by step
Messy data, again
Every model is only as good as its data, and Brightbank’s data arrives messy.
Raw data is messy
Real data arrives from apps, forms and sensors with duplicates, typos, missing values and wrong formats. A model trained on mess learns mess.
Clean it, automatically
A data pipeline runs the same cleaning steps every time: drop duplicates, fix types, fill or remove missing values. Automated means it’s repeatable, rather than one person’s spreadsheet edits.
Check before you trust
Add validation checks: ages between 0 and 120, prices above zero, no future dates. Bad batches are stopped before they reach the model.
Build features and keep versions
Turn clean data into features and store each batch with a version label. Months later you can say exactly which data trained which model, and rebuild it if needed.
In real life: a food-delivery app
Every order, GPS ping and rating flows through pipelines that clean and check it before it feeds arrival-time and recommendation models. Most of the day-to-day work on real ML teams is in pipelines like these.
Quick check: Why give your datasets version labels?
- So you can reproduce exactly which data trained a model (correct)
- To make the files bigger
- To hide the data
Versioned data makes results reproducible and problems traceable.
Pseudocode
raw = collect(app logs, forms, sensors) clean = remove duplicates, fix types, fill or drop missing values check = validate(clean) # e.g. ages must be between 0 and 120 features = build_features(clean) store(features, version = "2026-11-25") # reproducible
Key terms
- data pipeline
- The automated steps that collect, clean, check and store data for a model.
- validation check
- An automatic test that data looks sensible, like ages between 0 and 120.