January 2020
Beginner to intermediate
432 pages
11h 24m
English
In the previous recipes, we have seen that some features are categorical variables (originally represented as either object or category data types). However, most machine learning algorithms work exclusively with numeric data. That is why we need to encode categorical features into a representation compatible with the models.
In this recipe, we cover some popular encoding approaches:
In label encoding, we replace the categorical value with a numeric value between 0 and # of classes - 1—for example, with three distinct classes, we use {0, 1, 2}.
Read now
Unlock full access