Skip to content

Commit

Permalink
Merge pull request #5 from RUCAIBox/0.2.x
Browse files Browse the repository at this point in the history
FIX: bug fix in avg_actions_of_users && avg_actions_of_items (RUCAIBox#576)
  • Loading branch information
linzihan-backforward authored Dec 12, 2020
2 parents 7518311 + ac4a9f6 commit 0024efb
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 0024efb

Please sign in to comment.