How to do it...

  1.  We will use the movie rating data for the SVD analysis. The movieLens 1M dataset contains around 1 million records which consist of anonymous ratings of around 3,900 movies made by 6,000 movieLens users.

The dataset contains the following files:

  • ratings.dat: Contains the user ID, movie ID, ratings, and timestamp
  • movies.dat: Contains the movie ID, titles, and genres
  • users.dat: Contains the user ID, genders, ages, occupations, and zip code
  1. We will use the ratings.dat for our SVD analysis. Sample data for the ratings.dat looks like the following:
1::1193::5::9783007601::661::3::9783021091::914::3::9783019681::3408::4::9783002751::2355::5::978824291 ...

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.