O'Reilly logo

Apache Spark 2.x Machine Learning Cookbook by Shuen Mei, Broderick Hall, Meenakshi Rajendran, Siamak Amirghodsi

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

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

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