One-Hot Encoding - Yousef's Notes
One-Hot Encoding

One-Hot Encoding

One-hot encoding transforms a categorical attribute into several binary ones.

For example, you can transform the categorical variable “color” with possible values “red”, “yellow”, and “green” into a three-dimensional binary vector:

red = [1, 0, 0] yellow = [0, 1, 0] green = [0, 0, 1]