Using Category Embeddings in Linear Regression Model


I am a new user and am working on a prediction model. I have several categorical variables and I want to use “categorial embeddings” which I train in Keras. For example, I have an education variable with 6 levels that I reduced to a continuous vector with two elements. I have an job variable with 8 levels that I encode to a continuous vector with three elements, etc.

How do I include that in my Stan model?


Alex Terrazas

Hi Alex! Welcome to the Stan Forum!

I’m no expert in this area, but supposedly you enter the newly generated variables just like any other (linear) regressor, no? So, use Keras to create/extract the features (embeddings) and use them as data in your Stan model. Does this make sense?


1 Like