Machine Learning Engineering · Module 11
Data preparation and feature engineering
- Lessons
- 13
- Free
- 0
- Reading
- ~3 h
Your progress
0 / 13 lessons done
Sign in to trackLessons
- Data quality for ML: what breaks modelsMost model failures in production are data failures that no error message reports. An ML engineer who checks each batch against what the model learned from finds them in minutes, not in a quarterly review.
- Missing values: dropping, filling or flaggingAlmost every real table has blanks, and the quick fix of dropping rows quietly changes who the model learns from and who it can score. How you treat a blank is a modelling decision, and it has to work the same way on scoring day as in training.
- Encoding categories as numbersAlmost every business table has categories: cities, channels, pincodes, product types. The encoding decides whether the model can learn from them at all, and a careless one either hides the signal or leaks the label into training.
- Scaling and normalizing featuresScaling is one line in a pipeline, so it is easy to copy from a template without thinking. The wrong scaler can make a model ignore a useful feature without any error, and the right one decides how distance and penalty models see your data.
- Feature engineering for tabular dataMost business data arrives as events: orders, clicks, payments. A tabular model sees one row per customer, so the features an engineer builds from those events usually decide more of the model’s quality than the choice of model does.
- Text features: from word counts to embeddingsReviews, support messages, search queries and product descriptions hold signals that no numeric column has. Turning them into features is a routine ML task, and the choice between counted words and model-made vectors decides cost, speed and what the model can explain.
- Time-based features without looking aheadMost business features are counts, totals and statuses that change over time. Built carelessly, they carry facts from after the prediction moment, and the model looks better in the notebook than it ever will in production.
- Data leakage: when a model secretly cheatsEvery model that looks far better in the notebook than in production is a candidate. Leaks rarely raise an error; they show up as a great offline score and a disappointing first week, after the business has planned around the great score.
- Labeling data: people, LLMs and quality checksMany useful models have no label column waiting for them: someone has to read the reviews, photos or tickets and decide. The model can only be as right as those decisions, and its test score is only as honest as the labels it is graded against.
- Feature stores: one feature, training and servingAs soon as a model is scored somewhere other than the notebook, its features are computed twice: once for training and once for serving. A feature store is how teams keep those two the same, and it is often the first piece of ML infrastructure a company builds.
- Case: Meesho’s feature store at 1M reads a secondOnce a model scores users while they browse, its features must be read in milliseconds, at sale-day peaks, without the cost growing as fast as the traffic. Meesho’s engineers wrote down what broke in their first feature store and what they changed, with numbers.
- Data augmentation: more examples from existing onesLabelled examples are the slowest and most expensive part of most ML projects. Augmentation is the cheapest way to get more out of the ones you have, and a wrong choice of augmentation quietly teaches the model something false.
- Datasets: versioning and documentationSooner or later someone asks what a live model was trained on: after a bad week, a deletion request or an audit. Teams that kept only a file path can’t answer, and can’t tell a data change from a code change when a score moves.
Practise with
No tools or paper guides for this module yet.
Terms this module teaches 4
Open glossaryAs-of join
A join that matches each row to the latest row of another table at or before the row’s time, instead of to an exact key.
Data leakage
When training data contains information the model would not have at prediction time, so its scores look better than it will really do.
Feature store
A system that keeps model features with their history, joins them point in time for training, and serves the same values to live predictions.
Recorded time
The time a record first appeared in a company’s data, which can be later than the time the event it describes happened.