Recommendation system for frequently changing data in MongoDB

Viewed 54

I have a website built with Node.js and MongoDB. Documents are structured something like this:

{
      price: 500,
      location: [40.23, 49.52],
      category: "A"
}

Now I want to create a recommendation system, so when a user is watching item "A" I can suggest to him/her similar items "B", "C" and "D".

The thing is collection of items is changing relatively often. New items are created every hour and they do exist only for about a month.

So my questions are:

  1. What algorithm should I use? Cosine similarity seems to be the most suitable one.
  2. Is there a way to create such recommendation system with Node.js or it's better to use python/R?
  3. When similarity score must be calculated? Only once (when a new item is created) or I should recalculate it every time a user visits an item page?
1 Answers

What algorithm should I use? Cosine similarity seems to be the most suitable one.

No one can really answer this for you, what makes a product similar to you? this is 100% product decision, it sounds like this is more of a pet side project and in that case I'd say use whatever you'd like.

If this is not the case I would assume best recommendations would be based on purchase correlation, i.e previous Users that bought product "A" also bought (or looked) at product "B" the most, hence it should be the top recommendation. Obviously you can create a much more complex model in the future.


Is there a way to create such recommendation system with Node.js or it's better to use python/R?

If it's a basic rule based system it can be done in node with ease, for any more data science related approach it will be more natural to implement this in python/R


When similarity score must be calculated? Only once (when a new item is created) or I should recalculate it every time a user visits an item page?

Again it depends on what your score is, how many resources you can invest, what the scale is etc.


as I mentioned before It sounds like this is a personal project. If this is the case I would try and choose the simpler solution for all these questions. Once you have the entire project up and running it'll be easier to improve on.

Related