Give an example of one-hot encoding.
Give an example of one-hot encoding.
Assume that our model has a city explanatory variable that can take one of three values: New York, San Francisco, or Chapel Hill. One-hot encoding represents this explanatory variable using one binary feature for each of the three possible cities.
[[ 0. 1. 0.] [ 0. 0. 1.][ 1. 0. 0.]]