Setting up a Restricted Boltzmann machine for Collaborative Filtering
In this recipe, you will learn how to build a collaborative-filtering-based recommendation system using an RBM. Here, for every user, the RBM tries to identify similar users based on their past behavior of rating various items, and then tries to recommend the next best item.
Getting ready
In this recipe, we will use the movielens dataset from the Grouplens research organization. The datasets (movies.dat
and ratings.dat
) can be downloaded from the following link. Movies.dat
contains information of 3,883 movies and Ratings.dat
contains information of 1,000,209 user ratings for these movies. The ratings range from 1 to 5, with 5 being the highest.
How to do it...
This recipe covers the steps for setting up collaborative filtering using an RBM.
- Read the
movies.dat
datasets in R:
txt <- readLines("movies.dat", encoding = "latin1") txt_split <- lapply(strsplit(txt, "::...