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
About the Authors
About the Reviewer

Data preparation

This section will show you how to prepare the data to be used in recommender models. Follow these steps:

  1. Select the relevant data.

  2. Normalize the data.

Selecting the most relevant data

When we explored the data, we noticed that the table contains:

  • Movies that have been viewed only a few times. Their ratings might be biased because of lack of data.

  • Users who rated only a few movies. Their ratings might be biased.

We need to determine the minimum number of users per movie and vice versa. The correct solution comes from an iteration of the entire process of preparing the data, building a recommendation model, and validating it. Since we are implementing the model for the first time, we can use a rule of thumb. After having built the models, we can come back and modify the data preparation.

We will define ratings_movies containing the matrix that we will use. It takes account of:

  • Users who have rated at least 50 movies

  • Movies that have been watched at least 100 times

The preceding points...