Skip to content

Commit

Permalink
Revised to slice interaction_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
myui committed Dec 10, 2024
1 parent ad60ba1 commit 57071fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rtrec/models/slim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def fit(self, user_interactions: Iterable[Tuple[Any, Any, float, float]], update
except Exception as e:
logging.warning(f"Error processing interaction: {e}")
continue
interaction_matirx = self.interactions.to_csc()
self.model.partial_fit_items(interaction_matirx, item_ids)
interaction_matrix = self.interactions.to_csc()
self.model.partial_fit_items(interaction_matrix[:,item_ids], item_ids)

def _recommend(self, user_id: int, candidate_item_ids: List[int], top_k: int = 10, filter_interacted: bool = True) -> List[int]:
"""
Expand Down

0 comments on commit 57071fe

Please sign in to comment.