CC This work is licensed under the Creative Commons Attribution 4.0 International License. For questions please contact Michael Hahsler.

library("recommenderlab")
## Loading required package: Matrix
## Loading required package: arules
## 
## Attaching package: 'arules'
## 
## The following objects are masked from 'package:base':
## 
##     abbreviate, write
## 
## Loading required package: proxy
## 
## Attaching package: 'proxy'
## 
## The following object is masked from 'package:Matrix':
## 
##     as.matrix
## 
## The following objects are masked from 'package:stats':
## 
##     as.dist, dist
## 
## The following object is masked from 'package:base':
## 
##     as.matrix
## 
## Loading required package: registry

Rating Data

data("Jester5k")
Jester5k
## 5000 x 100 rating matrix of class 'realRatingMatrix' with 362106 ratings.
getRatingMatrix(Jester5k)[1:10,1:5]
## 10 x 5 sparse Matrix of class "dgCMatrix"
##           j1    j2    j3    j4    j5
## u2841   7.91  9.17  5.34  8.16 -8.74
## u15547 -3.20 -3.50 -9.56 -8.74 -6.36
## u15221 -1.70  1.21  1.55  2.77  5.58
## u15573 -7.38 -8.93 -3.88 -7.23 -4.90
## u21505  0.10  4.17  4.90  1.55  5.53
## u15994  0.83 -4.90  0.68 -7.18  0.34
## u238    2.91  4.76  .     .     .   
## u5809  -2.77 -6.31  2.23  .     0.19
## u16636 -3.35 -5.92 -5.63 -3.01  1.70
## u12843 -1.99 -6.89  2.09 -4.42 -4.90
as(Jester5k, "matrix")[1:10, 1:5]
##           j1    j2    j3    j4    j5
## u2841   7.91  9.17  5.34  8.16 -8.74
## u15547 -3.20 -3.50 -9.56 -8.74 -6.36
## u15221 -1.70  1.21  1.55  2.77  5.58
## u15573 -7.38 -8.93 -3.88 -7.23 -4.90
## u21505  0.10  4.17  4.90  1.55  5.53
## u15994  0.83 -4.90  0.68 -7.18  0.34
## u238    2.91  4.76    NA    NA    NA
## u5809  -2.77 -6.31  2.23    NA  0.19
## u16636 -3.35 -5.92 -5.63 -3.01  1.70
## u12843 -1.99 -6.89  2.09 -4.42 -4.90
head(rowCounts(Jester5k))
##  u2841 u15547 u15221 u15573 u21505 u15994 
##     81     71    100    100     72    100
hist(rowCounts(Jester5k))

hist(colCounts(Jester5k))

Original data

hist(getRatings(Jester5k))

image(Jester5k[1:100,], main = "Raw Ratings")