The objective of this chapter is to recommend to your friend, pages that they might like. We will build this recommendation using the Apriori algorithm. The following code will be useful for building the recommendation model. It makes use of the Apriori algorithm to build, generate the rules, and hence extract the patterns in the data that can be used as recommendation. Let's understand the code in detail:
friends<- getFriends(token, simplify = TRUE) head(friends, 26) friend1<- getLikes("500637447", n = 100, token) friend2<- getLikes("505108142", n = 100, token) friend1$user <- "friend1" friend2$user <- "friend2" friendlikedata<- rbind(friend1, friend2) head(friendlikedata) forRecc<- friendlikedata[,c("user", "id")] write.csv(forRecc,"C:/Users/Sharan/Desktop/Chapter 3/forRecc.csv", row.names = FALSE, col.names = NA) library(arules) data = read.transactions(file="C:/Users/Sharan/Desktop/Chapter 3/forRecc.csv", rm.duplicates= FALSE, format="single...