Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

誤って row["user_id"] が使われているところ user_id に変更 #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chapter5/src/nmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def recommend(self, dataset: Dataset, **kwargs) -> RecommendResult:
for user_id in dataset.train.user_id.unique():
if user_id not in user_id2index:
continue
user_index = user_id2index[row["user_id"]]
user_index = user_id2index[user_id]
movie_indexes = np.argsort(-pred_matrix[user_index, :])
for movie_index in movie_indexes:
movie_id = user_movie_matrix.columns[movie_index]
Expand Down
2 changes: 1 addition & 1 deletion chapter5/src/svd.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def recommend(self, dataset: Dataset, **kwargs) -> RecommendResult:
for user_id in dataset.train.user_id.unique():
if user_id not in user_id2index:
continue
user_index = user_id2index[row["user_id"]]
user_index = user_id2index[user_id]
movie_indexes = np.argsort(-pred_matrix[user_index, :])
for movie_index in movie_indexes:
movie_id = user_movie_matrix.columns[movie_index]
Expand Down