yyipkei

Results 1 comments of yyipkei

Thanks, I have rewritten the code as below. ``` def sample_recommendation(data, all_predictions, user_id , k): known_positives = data['itemID'][data['userID'].str.strip() == user_id] top_items = all_predictions.loc[all_predictions['userID'].str.strip() == user_id].sort_values(by='prediction', ascending=False).head(k) print("User %s" % user_id)...