An encoding layer converts categorical values into numeric representations directly during neural-network training. This can avoid the one-hot-encoding preparation commonly used for linear regression or logistic regression. section 12.1
Choosing an encoding approach
For a categorical feature such as room type, a linear model may receive separate one-hot columns for categories such as entire home, hotel room, private room, and shared room. A neural network can instead use an encoding layer to convert those categorical values into numeric representations during training. section 12.1
