1
$\begingroup$

Hei, I have a list of purchase baskets from customers and would like to build embeddings for the products.

For example:
BASKET1 = ['PRODUCT234', 'PRODUCT214', 'PRODUCT768']
BASKET2 = ['PRODUCT2', 'PRODUCT43', 'PRODUCT7684', 'PRODUCT65']

I was thinking of using something like Word2Vec by using the productIDs composing a basket as words and the baskets themselves would be sentences. The question that I am having at the moment is how to introduce sequentiality to my product basket as, unlike words, I do not have the sequence at which they were added to the basket. Think, for example, about a supermarket basket where items end up being scanned in a random order.

One way I was thinking of introducing some artificial sequence was by ordering productIDs but I do not have any rationale to justify such an approach.

Would you have any comments regarding this approach? Any suggestion as to an alternative model that would produce the desired embeddings? I would like to use embeddings to recommend similar products or products that occur in the same basket.

$\endgroup$
2
  • $\begingroup$ Interesting idea, why not try it. There is a similar method called node2vec. Your might also have heard about the old Netflix competition where a simple gradient-based matrix factorization was used. One of the papers comparing the methods. $\endgroup$
    – Valentas
    Commented Jun 23, 2022 at 8:01
  • $\begingroup$ Also if you have a small dataset your embedding could just be the sparse vector with 1s at basket ids, possibly normalized. $\endgroup$
    – Valentas
    Commented Jun 23, 2022 at 8:09

1 Answer 1

0
$\begingroup$

You can try simpler methods before word2vec type shallow neural networks.

  1. for example: Create User product matrix, transpose it to get product-user matrix. Weight them with TF-IDF. Then by applying dimesionality reduction you can take products to lower dimensional space and calculate similarities. User-product matrix can be used to find similar users to later apply collaborative filtering on.
  2. Another way is to get product-product matrix and UP`.UP. Then calculate Pointwise mutual information as weighting on that matrix to calculate similarity.

Here"s a sample notebook you can appropriate to your own purpose.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.