Machine Learning · Module 10 of 12

Feature Engineering & Pipelines

Lessons

About This Lesson

Models are only as good as the data you feed them. Feature engineering is the work of turning raw data into inputs a model can learn from: encoding categories as numbers, filling in missing data, and keeping the features that matter.

You'll learn how to encode categorical features, how to impute missing values, and how to select useful features. Then you'll tie it all together with pipelines, which chain every preprocessing step and the model into one repeatable workflow and prevent data leakage during cross-validation.

Watch the videos in order, then build a pipeline for a dataset with both numeric and categorical columns. When you're done, continue on to Clustering & PCA.

Lessons

4 videos
01

How to encode categorical features with scikit-learn

How to one-hot encode categories with OneHotEncoder, select columns with ColumnTransformer, and cross-validate the whole thing in a Pipeline.

02

Impute missing values using KNNImputer or IterativeImputer

Two scikit-learn imputers that fill in missing numeric values by learning from the other features.

03

Add feature selection to a Pipeline

How to keep only the most useful features by adding a feature selection step to your pipeline.

04

Use Pipeline to chain together multiple steps

How a Pipeline chains preprocessing and a model into one repeatable workflow that avoids data leakage.