user_based_recom: Similarity between other users to have a list of anime that...

Description Usage Arguments Value Author(s) Examples

View source: R/anime_functions.R

Description

Use the user item matrix to search for similar users in order to get the anime they graded the best and that we have not watched

Usage

1
2
3
4
5
6
7
8
user_based_recom(
  userid = 999999999,
  user_item_matrix,
  ratings_data,
  n_recommendation = 5,
  threshold = 1,
  nearest_neighbors = 10
)

Arguments

userid

user id, set to 999999999 so that there is no conflict with other Id's

user_item_matrix

matrix created by the function 'user_item_matrix'

ratings_data

table of ratings similar to the one we kept

n_recommendation

number of recommendations wanted

threshold

threshold level of number of user that gave a score to the anime

nearest_neighbors

number of neighbors taken into account for the computation

Value

Return a table composed of 'n_recommendation' that the user have not seen yet

Author(s)

Marie Bellier, Massimo Finini, Meri Likoska, Vania Rodrigues Telo Ramos, Xavier Renger

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#Simple example to showcase what is happening in the application

#import dataset from the package
anime_with_ratings <-  tibble::tibble(ProjectG5::anime_with_ratings)

#selection of the user example
names_selected <- c("Death Note", "Naruto")
score_entered <- c(10,7)

temp_tibble <- tibble::tibble(Name = names_selected, rating = score_entered)

anime_selected <- dplyr::left_join(anime, temp_tibble, by = c("Name" = "Name"))
anime_selected <- dplyr::filter(anime_selected, Name %in% names_selected)
anime_selected <- dplyr::mutate(anime_selected, user_id = 999999999)

#creation of the matrix with what the user selected
item_matrix <- user_item_matrix(anime_with_ratings, adding_row = TRUE, row_data = anime_selected)

user_based_recom(999999999, item_matrix, anime_with_ratings, 5, 1, 10)

ptds2021/project--G5 documentation built on Dec. 22, 2021, 9:59 a.m.