Feature Engineering

Learn how to apply domain knowledge and data transformation techniques to perform feature engineering.

Machine learning models expect data to be formatted in a specific way. Feature engineering is the phase we use when we bring out all our data-transformation tools and techniques to shape and create features before feeding them into our model. Feature engineering techniques include, but are not limited to:

  • Missing value handling

  • Handling outliers

  • Categorical encoding

  • Feature splitting

  • Variable transformation

Categorical encoding

The customer dataset contains a couple of categorical features in a string format. Machine learning algorithms expect only numeric values as parameters, so we need to convert categorical features into numerical ones. This is known as encoding. There are different ways to encode categorical features. In this lesson, we’ll use the simple label encoding technique to assign each category a unique number (e.g. Male = 1, Female = 2).

Our categorical features will be encoded as shown in the table below.

Get hands-on with 1200+ tech skills courses.