Tutorial
이다.Evaluation measures are: + Rating errors: MSE, RMSE, MAE + Top-N recommendations: TPR/FPR (ROC), precision and recall
# install.packages("recommenderlab")
library(recommenderlab)
help(package = "recommenderlab")
data("MovieLense")
MovieLense100 <- MovieLense[rowCounts(MovieLense) > 100,]
MovieLense100
## 358 x 1664 rating matrix of class 'realRatingMatrix' with 73610 ratings.
rowCounts
의 뜻은 행의 총합을 의미하며, 이 때 100개 이상의 데이터만 추출하겠다는 뜻임
train <- MovieLense100[1:70]
rec <- Recommender(train, method = "UBCF")
rec
## Recommender of type 'UBCF' for 'realRatingMatrix'
## learned using 70 users.
pre <- predict(rec, MovieLense100[101], n = 10)
as(pre, "list")
## $`291`
## [1] "Braindead (1992)"
## [2] "Bad Taste (1987)"
## [3] "Mrs. Brown (Her Majesty, Mrs. Brown) (1997)"
## [4] "Cry, the Beloved Country (1995)"
## [5] "Gridlock'd (1997)"
## [6] "Charade (1963)"
## [7] "Nosferatu (Nosferatu, eine Symphonie des Grauens) (1922)"
## [8] "Ruling Class, The (1972)"
## [9] "Brassed Off (1996)"
## [10] "It's My Party (1995)"