O'Reilly logo

Building a Recommendation System with R by Suresh K. Gorakala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required