A nominal feature groups examples into named categories without ranking them. In a T-shirt price task, color is nominal: red, blue, and green are simply different labels, while size is ordinal because S < M < L < XL. section 8.1.1
Machine-learning models usually need categorical values converted into numbers. Assigning integers to nominal categories is arbitrary and can falsely suggest an order, so encoding requires attention to both the feature’s meaning and the model’s interpretation. section 8.1.2
Distinguish nominal data from related encoding choices:
- Nominal categories have no inherent ordering; ordinal categories do. section 8.1.1
- Ordinal encoding assigns integer labels, but those numbers impose an ordering even when categories are nominal. section 8.1.2
- One-hot encoding creates binary columns for categories, avoiding a sequential numeric label for each nominal value. section 8.1.2 section 8.5
Encoding T-shirt attributes
For color values red, green, and blue, OneHotEncoder produces three binary columns; a separate four-column representation can encode sizes XL, L, M, and S. The resulting rows contain indicators such as [1, 0, 0] for red rather than an ordered color score. section 8.1.2
Figure 8.1 T-shirts in this example data set are described using two categorical features: color and size. Categorical features can be either (1) nominal, where there is no ordering between the various categories, or (2) ordinal, where there is an ordering between the categories. The third feature in this data set, cost, is a continuous, numeric variable.
Compare nominal color, ordinal size, and continuous cost in the T-shirt feature diagram. section 8.1.1



