jadianes / spark-movie-lens

An on-line movie recommender using Spark, Python Flask, and the MovieLens dataset
Other
816 stars 395 forks source link

logic error in function "get_top_ratings" when get "user_unrated_moies_RDD" #5

Closed movingheart closed 8 years ago

movingheart commented 8 years ago

file:engine.py ->function:get_top_ratings, code as user_unrated_movies_RDD = self.movies_RDD.filter(lambda rating: not rating[1]==user_id).map(lambda x: (user_id, x[0])) Element of self.movies_RDD as (movie_id, movie_title, movie_category), "rating[1]" represent "movie_title";I guess "self.movies_RDD" should be "self.ratings_RDD"; Please check this question.

movingheart commented 8 years ago

This line can be: user_unrated_movies_RDD = self.ratings_RDD.filter(lambda rating: not rating[1]==user_id).map(lambda x: (user_id, x[1]))

jadianes commented 8 years ago

Hi @movingheart,

You're right. Thanks!