[1] Movie recommendation(Scala)

Movie recommendation with Spark ALS


In this notebook, we will find users that like comedy and recommend movies for them.

All input data is publicly accessible at http://grouplens.org/datasets/movielens/



Find users that like comedy

  1. All five stars given by this user are for comedy movies
  2. This user has given 10+ five stars


Train the model


xxxxxxxxxx
 
// ratings RDD, rank, iterations
val model = ALS.train(ratings, 16, 10)
model: org.apache.spark.mllib.recommendation.MatrixFactorizationModel = org.apache.spark.mllib.recommendation.MatrixFactorizationModel@70d02ad8

Recommend movies to a user that likes comedy



xxxxxxxxxx
 
displayHTML(result)

xxxxxxxxxx