Skip to content

Commit

Permalink
chore: fix typo (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
leemengtw authored Jul 20, 2022
1 parent 48e111b commit 8c2a323
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rsdiv/recommenders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ def predict(
def predict_for_userId(self, user_id: int) -> np.ndarray:
user_ids: np.ndarray = np.full(self.n_items, user_id - 1)
item_ids: np.ndarray = np.arange(self.n_items)
predicton = self.predict(
prediction = self.predict(
user_ids, item_ids, self.user_features, self.item_features
)
return predicton
return prediction

def predict_for_userId_unseen(self, user_id: int) -> np.ndarray:
seen = (
self.df_interaction[self.df_interaction["userId"] == user_id]["itemId"] - 1
)
predicton = self.predict_for_userId(user_id)
predicton[seen] = -np.inf
return predicton
prediction = self.predict_for_userId(user_id)
prediction[seen] = -np.inf
return prediction

def predict_top_n_unseen(self, user_id: int, top_n: int) -> Dict[int, float]:
prediction = self.predict_for_userId_unseen(user_id)
Expand Down

0 comments on commit 8c2a323

Please sign in to comment.