Task definition

I've been tasked to build a recommender system and I have to admit I'm a beginner in this field. Entities in my system are buyers and unique products that could be bought. You could imagine the product as an original of the painting - only one user could buy it and thus only one "rating/feedback" could be given to this product. Relation between users and products could look like this (1=product bought by user):

- product_1 product_2 product_3 product_4 product_5 product_6
user_1 1 0 0 1 0 0
user_2 0 0 1 0 1 0
user_3 0 1 0 0 0 0
user_4 0 0 0 0 0 1

Both users and products could be defined by many features (dozens), for example:

  • user - proportion of products bought are paintings, ...
  • product - is_painting, is_statue, ...

You could imagine the table of products bought to be pretty sparse -> many users and many products. Most of the users bought just a single product, but a few users bought plenty of products. I strongly believe users with highly correlated feature vectors are going to be focusing on products with similar feature vectors.

Problem I want to solve

I want to be able to provide the model a user_id and a list of products and get the most probable products bought by the user, so it's a scoring problem.

I struggle to define what technique should I actually apply to this. I feel content-based filtering it's not good for this problem because I don't have much historical data about a single user. Collaborative filtering is also questionable since there is no collaboration because products are always bought by a single user.

I would really appreciate your thoughts on how to approach this problem, what techniques, tools or frameworks you would utilize to solve this.


1 Answer 1


As you noticed, standard recommender systems that work like "other users who bought X, bought also Y" won't work for you, because the items are unique. You don't have the many-to-many relations that would enable you to learn that the products are alike based on how users interact with them.

What you need to do is to find another way of judging what products are similar to each other, so if a user bought product X, you can recommend them product Y that shares similar characteristics. You can do this either based on some explicit features describing the products or by learning latent representations of the products. The first case needs you to have relevant data on the features of the products, e.g. car brand, color, technical characteristics, etc. The second case would be something like using an autoencoder, using one of the many available neural networks for NLP problems to a latent encoding, or using CNN to translate images to such representation, etc. If you have such a representation of the products (features or learned) the only thing left is using a similarity metric to find similar items to the ones already owned by the user (e.g. nearest neighbors search). Here the latent representation is not learned from the many-to-many relations (the "collaboration"), but this can be (in fact, needs to) learned from the products independently from the users. Nonetheless, you would need to validate how much the representations are useful for making the recommendations.

You may also need to be able to represent users using latent vectors, like matrix factorization does, to be able to aggregate users' preferences from many bought products. This wouldn't differ from how other recommender systems work.

You are worried about users not having many products bought, but this is a standard cold start problem that appears in all the recommender systems. If a user bought no items then you don't know anything about their preferences, so you can recommend the most popular products globally, or something that "average" users buy, randomize it somehow, etc which basically means that you assign some prior preference to the users that is updated when you gather more data. If they bought a single product, you can base your recommendations only on this product alone but this may backfire. For example, say that a user bought a toilet seat, this doesn't make them a toilet seat fan, you should not recommend more of them. A more reasonable strategy would be to combine your prior preference with new knowledge and create a new representation for the user that lands somewhere in between.

I'm deliberately not talking here about specific algorithms, because there are many of them, and I'm not an expert in this area and not the most up-to-date with them. For more information, you can check other questions tagged as , books, and papers on this topic. You would easily find many papers on content-based filtering that do this, or models that use the features as an additional source of information that can be an inspiration, or just give you more references.


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.