Is a type of data whose values come from a finite set of categories, or states. A label such as “cat” or “dog” is categorical; a weight such as 4.2 is numerical. In supervised learning, models that predict categories are called classification models. section 2.2 section 2.2
Categorical values can appear as labels or as features:
- Animal type (cat or dog) and email status (spam or ham) are categorical labels. section 2.2
- Gender and port of embarkation are categorical features in passenger data. section 13.3
- One-hot encoding converts categorical features to numbers; binning can turn numerical features into categories. section 13.3
Figure 13.1 One-hot encoding our data to turn it all into numbers for the machine learning model to read. On the left, we have columns with categorical features such as gender or port of embarkment. On the right, we have turned these categorical features into numerical features.
Compare categorical feature columns with their numerical representation after one-hot encoding. section 13.3















