Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. def recommend(self,topu=10):#no arguement required here, just for the sake of uniformness across other recommender implementations
  2. #return self.mean_ratings.ix[:topu,'title'].as_matrix(columns = None).tolist()
  3. self.mean_ratings = self.mean_ratings.sort(['movie_id'],ascending=True)
  4. self.mean_ratings = self.mean_ratings.ix[:,2:3]
  5. self.mean_ratings = self.mean_ratings.reset_index()
  6. del self.mean_ratings['index']
  7. return self.mean_ratings.ix[:topu,'title'].as_matrix(columns = None).tolist()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement