<jupyter_start><jupyter_text>Compare the predicted rating using Cosine and Pearson similarity<jupyter_code>pearson_rating = usercf.predict_ratings(20, 'Pearson')
cosine_rating = usercf.predict_ratings(20, 'Cosine')

sorted_pearson_rating = {k: v for k, v in sorted(pearson_rating.items(), key=lambda item: item[1], reverse=True)}
pearson_rating_ = [pearson_rating[item] for item in sorted_pearson_rating.keys()]
cosine_rating_ = [cosine_rating[item] for item in sorted_pearson_rating.keys()]
plt.figure(dpi = 100)
plot = sns.scatterplot(pearson_rating_, cosine_rating_)
plot.set(xlabel='Pearson rating', ylabel = 'Cosine rating', title = 'Pearson Rating and Cosine Rating')<jupyter_output>/usr/local/lib/python3.7/dist-packages/seaborn/_decorators.py:43: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
  FutureWarning
{'fraction_non_alphanumeric': 0.09910802775024777, 'fraction_numerical': 0.014866204162537165, 'mean_word_length': 7.145161290322581, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '284773', 'license': 'MIT', 'n_tokens_mistral': 341, 'n_tokens_neox': 319, 'n_words': 91, 'path': 'notebooks/example_memoryCF.ipynb', 'repo_name': 'huynhnhathao/recommender_system_from_scratch', 'size': '1009'}