O'Reilly logo

Mastering Predictive Analytics with R - Second Edition by Rui Miguel Forte, James D. Miller

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

Exploring the data

Before building and evaluating recommender systems using the two datasets we have loaded, it is a good idea to get a feel for the data. For one thing, we can make use of the getRatings() function to retrieve the ratings from a rating matrix. This is useful in order to construct a histogram of item ratings. Additionally, we can also normalize the ratings with respect to each user, as we discussed earlier. The following code snippet shows how we can compute ratings and normalized ratings for the jester data. We can then do the same for the MovieLens data and produce histograms for the ratings:

>jester_ratings<- getRatings(jester_rrm)
>jester_normalized_ratings<- getRatings(normalize(jester_rrm, 
                                          method = "Z-score"))

The following ...

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