O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

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

How it works...

The basic idea of content-based filtering algorithms starts with a description of items and for each user, the algorithms recommend items that are similar to its past purchases through the following steps:

  1. Define item descriptions.
  2. Define user profiles based on purchases.
  3. Recommend to each user the items matching their profile.

User profiles are calculated from their purchases, so the algorithms recommend items similar to past purchases.

Step 1: We rename the column names and remove unwanted columns from the datasets.

Step 2: We verify the structure of the datasets to check the number of variables and its type.

Step 3: In the clusterMovies() function, we have used the k-means approach to cluster and choose the number of ...

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