Skip to content

Commit

Permalink
FIX: bug fix in avg_actions_of_users && avg_actions_of_items (#576)
Browse files Browse the repository at this point in the history
* FEA: add three models by Shao Weiqi (HRM, NPE, SHAN).

* FEA: add three models' test.

* FIX: bug fix in interaction.update

* FEA: add model HGN by Shao Weiqi.

* FIX: bug fix in avg_actions_of_users && avg_actions_of_items
  • Loading branch information
chenyushuo authored Dec 12, 2020
1 parent 64ea090 commit ac4a9f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions recbole/data/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def avg_actions_of_users(self):
Returns:
numpy.float64: Average number of users' interaction records.
"""
return np.mean(list(Counter(self.inter_feat[self.uid_field]).values()))
return np.mean(list(Counter(self.inter_feat[self.uid_field].numpy()).values()))

@property
def avg_actions_of_items(self):
Expand All @@ -1117,7 +1117,7 @@ def avg_actions_of_items(self):
Returns:
numpy.float64: Average number of items' interaction records.
"""
return np.mean(list(Counter(self.inter_feat[self.iid_field]).values()))
return np.mean(list(Counter(self.inter_feat[self.iid_field].numpy()).values()))

@property
def sparsity(self):
Expand Down

0 comments on commit ac4a9f6

Please sign in to comment.