Learn Before
Concept
One-Hot Encoding
Because most classification problems lack a natural ordering among classes, categorical labels are typically represented using a one-hot encoding. A one-hot encoding is a vector with as many components as there are categories, where the element corresponding to the true category is set to and all other elements are set to . For example, a label for three classes might be represented as the three-dimensional vector .
0
1
Updated 2026-05-03
Tags
D2L
Dive into Deep Learning @ D2L