AmirShabani
commited on
Commit
·
db0d1d3
1
Parent(s):
c3dd99d
print embeddings
Browse files
core.py
CHANGED
@@ -159,10 +159,11 @@ def create_user_embedding(movie_ratings, movies_df):
|
|
159 |
# Convert the movie_ratings dictionary to a dataframe
|
160 |
user_ratings_df = pd.DataFrame.from_dict(movie_ratings, orient='index', columns=['rating'])
|
161 |
user_ratings_df['movieId'] = user_ratings_df.index
|
162 |
-
print(user_ratings_df)
|
163 |
-
print(user_movie_embeddings)
|
164 |
# Merge the user_ratings_df with the movies_df to get the movie embeddings
|
165 |
user_movie_embeddings = user_ratings_df.merge(movies_df, on='movieId', how='left')
|
|
|
|
|
|
|
166 |
|
167 |
# Multiply the ratings with the movie embeddings
|
168 |
user_movie_embeddings = user_movie_embeddings.iloc[:, 2:].values * user_movie_embeddings['rating'].values[:, np.newaxis]
|
|
|
159 |
# Convert the movie_ratings dictionary to a dataframe
|
160 |
user_ratings_df = pd.DataFrame.from_dict(movie_ratings, orient='index', columns=['rating'])
|
161 |
user_ratings_df['movieId'] = user_ratings_df.index
|
|
|
|
|
162 |
# Merge the user_ratings_df with the movies_df to get the movie embeddings
|
163 |
user_movie_embeddings = user_ratings_df.merge(movies_df, on='movieId', how='left')
|
164 |
+
|
165 |
+
print(user_ratings_df)
|
166 |
+
print(user_movie_embeddings)
|
167 |
|
168 |
# Multiply the ratings with the movie embeddings
|
169 |
user_movie_embeddings = user_movie_embeddings.iloc[:, 2:].values * user_movie_embeddings['rating'].values[:, np.newaxis]
|