One-hot encoding ensures that machine learning does not assume that higher numbers are more important.
In machine learning, one-hot encoding is a frequently used method to deal with categorical data.
[8] An example of ordinal data would be the ratings on a test ranging from A to F, which could be ranked using numbers from 6 to 1.
[9] Therefore, one-hot encoding is often applied to nominal variables, in order to improve the performance of the algorithm.
Another downside of one-hot encoding is that it causes multicollinearity between the individual variables, which potentially reduces the model's accuracy.
[10] In practical usage, this transformation is often directly performed by a function that takes categorical data as an input and outputs the corresponding dummy variables.