User-based collaborative filtering on binary data

Similar to IBCF, we need to use the Jaccard index for UBCF. Given two users, the index is computed as the number of items purchased by both the users divided by the number of items purchased by at least one of them. The mathematical symbols are the same as in the previous section:

User-based collaborative filtering on binary data

Let's build the recommender model:

recc_model <- Recommender(data = recc_data_train, method = "UBCF", parameter = list(method = "Jaccard"))

Using the same commands as IBCF, let's recommend six movies to each user, and let's take a look at the first four users:

n_recommended <- 6 recc_predicted <- predict(object = recc_model, ...

Get Building a Recommendation System with R now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.