O'Reilly logo

Building a Recommendation System with R by Suresh K. Gorakala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User-based collaborative filtering

In the previous section, the algorithm was based on items and the steps to identify recommendations were as follows:

  • Identify which items are similar in terms of having been purchased by the same people
  • Recommend to a new user the items that are similar to its purchases

In this section, we will use the opposite approach. First, given a new user, we will identify its similar users. Then, we will recommend the top-rated items purchased by similar users. This approach is called user-based collaborative filtering. For each new user, these are the steps:

  1. Measure how similar each user is to the new one. Like IBCF, popular similarity measures are correlation and cosine.
  2. Identify the most similar users. The options are:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required