June 2017
Beginner to intermediate
296 pages
7h 4m
English
We already looked at the code, but we'll open it up and take a look at it in Python just for completeness. So, open up the movie-recommendations-als.py file. A lot of this code is the same. We have the same boilerplate stuff. One thing to point out is that we do need to explicitly import the ALS and ratings classes from pyspark.mllib.recommendation in order to use them:
import sys from pyspark import SparkConf, SparkContext from pyspark.mllib.recommendation import ALS, Rating
Down in line 13, you can see we're going to run this across our entire set of cores that we have:
conf = SparkConf().setMaster("local[*]").setAppName("MovieRecommendationsALS")
Otherwise, everything is like we had ...
Read now
Unlock full access