In this chapter, we will use the dataset that was used in the Chapter 3, Pattern Discovery. This dataset has two columns, namely the userID and items. We will consider that the UserID
column represents the users and the Items
column represents the products purchased by the user.
Let's have a look at the dataset by reading the dataset to the R environment:
# reading the dataset rdata <- read.csv("Data/following.csv") head(rdata, 10)
The output of the preceding code is as follows:
Now, based on the purchase history of all the users, we need to recommend the products that the user might be interested in buying. This can be done by first identifying the similar users and then extracting the new products from the most similar users. We will get into the details of this approach in this chapter.
First of all, in order to build a recommendation system, we need to alter the dataset to a matrix in such a fashion that the items become the row names and the user ID will become...