R bloggers

Exploring Embeddings for Categorical Variables with Keras

FavoriteLoadingAdd to favorites

In order to stay up to date, I try to follow Jeremy Howard on a regular basis. In one of his recent videos, he shows how to use embeddings for categorical variables (e.g. weekdays). First off; what are embeddings?An embedding is a mapping of a categorical vector in a continuous n-dimensional space. The idea is to represent a categorical representation with n-continuous variables. To make it more concrete, let’s say you want to model the effect of day of the week on an outcome. Usually you would try to one-hot encode the variable, which means that you create 6 variables (each for one day of a week minus 1) and set the variable 1 or 0 depending on the value. You end up having a 6-dimensional space to represent a weekday.So, what is the advantage of mapping the variables in…
Original Post: Exploring Embeddings for Categorical Variables with Keras