Book Image

Building a Recommendation System with R

Book Image

Building a Recommendation System with R

Overview of this book

Table of Contents (13 chapters)
Building a Recommendation System with R
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
References
Index

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:

    • Take account of the top k users (k-nearest_neighbors)

    • Take account of the users whose similarity is above a defined threshold

  3. Rate the items purchased by the most similar users. The rating is the average rating among similar users and the approaches are...