Recommender systems are used, for example, to recommend you products you would maybe like to buy based on the products you bought or looked at and which people similar to you bought or looked at.

Problem can be stated like this. We have many products and we have to sort them by some measure (let’s call it a level of recommendation measure) so they are sorted from the products a person would most likely like to the ones it would most likely not like.

So, lets develop this kind of measure. For this we need to establish certain principles that should correspond to the real life. These are the principles:

- The more there are people who bought the product, the bigger the level of recommendation should be.
- The more similar these people are to the person we want to recommend the product to, the bigger the level or recommendation should be.
- Buying a product should have more weight than just looking at a product.
- The more similar are the items person has bought or looked at, the bigger the level of recommendation should be.

These are all the principles. Now, we have to put them into mathematical formulas, so we can use them in a computer program.

Firstly, lets define similarity properly. As you can see, we have two kinds of similarities to define, similarity between two people and similarity between two products.

Let’s put attributes to people. Then, two people are more similar the more there are identical attributes they have. Also, a person has bought or looked at some products. So, two people are more similar the more identical products they have bought or have looked at. So, the measure would be the size of intersection between the corresponding sets. And for the whole measure, lets weight these different sizes of intersections by priority and sum them all up to get the final “similarity between two people” measure.

#implementation #computer-science #similarity-metrics #recommender-systems #data science

1.25 GEEK