Using Category Embeddings in Linear Regression Model

Hello–

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?

Thanks

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?

Cheers,
Max

1 Like