In [ ]:
%matplotlib inline
import pandas as pd

from recommend import recommend_with_cosine_similarity

In [ ]:
from IPython.core.display import HTML
css = open('table.css').read() + open('notebook.css').read()
HTML('<style>{}</style>'.format(css))

In [ ]:
video_games = pd.read_json("videogames.json")
video_games.head(5)

In [ ]:
ratings = pd.read_csv("ratings.csv")
ratings.head(5)

Filter out video games which have no title


In [ ]:

Filter out video games which have less than 5 ratings


In [ ]:

Filter out users which have less than 5 ratings


In [ ]:

Merge ratings and videogames dataframe on productID and set to df dataframe


In [ ]:

Create a pivot matrix with index userID, columns productID and values ratings


In [ ]:

Set columns to productID variable


In [ ]:

Set index to userID variable


In [ ]:


In [ ]:
correlated_items = ratings_pivot.corr()["B002I0JZOC"].sort_values(ascending=False).head(5)
correlated_items.index

Recommend video games with pearsonR


In [ ]:

Recommend video games with cosine similarity


In [ ]:
cosine_similarity_matrix = recommend_with_cosine_similarity(ratings_pivot)["B002I0JZOC"].sort_values(ascending=False).head(5)
cosine_similarity_matrix.index

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: