What is one-of-k or one-hot encoding?

What is one-of-k or one-hot encoding?



The explanatory variable is encoded using one binary feature for each of the variable's possible values. It may seem intuitive to represent the values of a categorical explanatory variable with a single integer feature, but this would encode artificial information an order for the values of the variable that does not exist in the real world