Now that we have formed a strategy of fetching a variety of products within our recommendation, let's code it up (We'll continue from step 3 of Movie recommendations recipe). The code file is available as Chapter_12_Recommender_systems.ipynb in GitHub.
- Extract the embedding values of each movie using Word2Vec.
- Create a list of lists of various movies watched by all users:
user_list = movie_count['User2'].unique()user_movies = []for i in range(len(user_list)): total_user_movies = movie_count[movie_count['User2']==user_list[i]].copy() total_user_movies.reset_index(inplace=True) total_user_movies = total_user_movies.drop(['index'],axis=1) total_user_movies['Movies3'] = total_user_movies['Movies2'].astype(str) user_movies.append(total_user_movies['Movies3'].tolist()) ...