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:
- Define item descriptions.
- Define user profiles based on purchases.
- 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 ...