Item Recommendation - Collaborative Filtering

Assume you have a number of items to sell. You also have a number of users who already bought or rated some of these items. You need to recommend new items to your customers so that they keep buying! What to do now?

You make use of a recommendation engine, determine items to promote and see if it increases your sales. How can one implement such an engine?

Here is a summary of a straightforward method for beginners: Collaborative Filtering & tips to improve performance of this method.

For a user, there are two main steps:

  1. Find users who are similar to each other in their purchase/rating history. They are likely to have a similar taste.
  2. Use one user's history to recommend items for the other user.

A simple example

Assume there are three users who rated purchased items in a 1-5 scale. Their ratings were:

User 1 hasn't purchased E yet and it is important to know what user's rating value will be for E after a purchase. In the end, the rating value will determine whether E should be recommended to User 1 or not.

First find out the closest user to User 1 by evaluating ratings for commonly purchased items. Items A, B, C, D are the common ones for Users 1, 2, 3. One needs to compute a numerical value that represents the distance between users. The lower the value is, the more similar those users are. This value is calculated according to a formula of your choice, called distance metric

Here is my super simple distance metric: number of items which received the same rating from both users.

User 2 is the closest user to User 1 according to my distance calculation. My simple algorithm argues that User 1 will rate E by 5 just like User 2.

Improvements

This example is way too simplistic for the problem considering all the possibilities. Here are a number of improvements:

Recommendation is an important and endless topic that requires a huge effort to excel at. See NetFlix Prize and efforts devoted to collaborative filtering for an example. It is fun because one can always make the algorithm better!


June 2013