Data exploration

In this section, we will explore the MovieLense dataset. For this purpose, we will use recommenderlab to build recommender systems and ggplot2 to visualize their results. Let's load the packages and the data:

library("recommenderlab")
library("ggplot2")
data(MovieLense)
class(MovieLense)
## [1] "realRatingMatrix"
## attr(,"package")
## [1] "recommenderlab"

MovieLense is a realRatingMatrix object containing a dataset about movie ratings. Each row corresponds to a user, each column to a movie, and each value to a rating.

Exploring the nature of the data

Let's take a quick look at MovieLense. As explained in the previous section, there are some generic methods that can be applied to realRatingMatrix objects. We can extract their size ...

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

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