Skip to content

Commit

Permalink
Update test_recommender.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg authored May 22, 2024
1 parent eb16fcf commit 56a0ae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/cornac/models/test_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def test_fit(self):
model.score(0, [])
result = model.rank(0, history_items=[])
self.assertTrue((result[0][0:3] == [3, 2, 4]).all())
self.assertTrue((np.sort(result[0][3:5]) == [0, 1]).any()) # identical scores, sorting may affect the ordering
self.assertTrue((np.sort(result[0][3:5]) == [0, 1]).all()) # identical scores, sorting may affect the ordering
self.assertTrue((result[0][5:6] == [5]).all())
self.assertTrue((np.sort(result[0][6:9]) == [6, 7, 8]).any()) # identical scores, sorting may affect the ordering
self.assertTrue((np.sort(result[0][6:9]) == [6, 7, 8]).all()) # identical scores, sorting may affect the ordering


if __name__ == "__main__":
Expand Down

0 comments on commit 56a0ae7

Please sign in to comment.