embed_sessions
Trains an item2vec model on provided lists of items.
Lists of items may represent pages visited in a browsing session, shopping baskets and the products they contain, sentences of words, etc. The step calculates embeddings vectors for all item lists, such that two vectors are similar if their corresponding lists of items are similar. Similarity here is measured as an average over the individual items. Essentially, we first calculate embeddings vectors representing individual items (using word2vec), and then average over all items belonging to the same list/session.
As an example, consider a dataset containing shopping baskets. In this case the step will first calculate embeddings for individual products. The resulting vectors will be similar if they represent objects that are often bought together. E.g. the vectors for sausages and hot dog bread may be more similar to each other than those representing shampoo and toys. Then, to arrive at an embedding vector for each basket, we simply average over all its individual products. The result will capture the similarity between baskets in terms of the mix of products they contain. And so the vectors representing baskets of people buying a significant amount of baby products will be more similar to each other than to vectors representing baskets of people buying products for a BBQ party.
To only calculate individual item embeddings see the complementary embed_items step.
Also, we use gensim to train the item2vec model, so for further details also see it’s word2vec page.
Was this page helpful?