示例#1
0
 def test_rating_std_dist_on_items(self):
     dist, labels = Profile.rating_std_dist_on_items(self.dataset, stacks=6, stack_range=0.5)
     self.assertEqual(len(labels), 6)
     self.assertEqual(len(dist), 6)
     self.assertEqual(dist.tolist(), [0, 0, 1, 1, 3, 0])
示例#2
0
 def test_item_dist_on_users(self):
     dist, labels = Profile.item_dist_on_users(self.dataset, stacks=6, stack_range=1)
     self.assertEqual(len(labels),6)
     self.assertEqual(len(dist),6)
     self.assertEqual(dist.tolist(),[0, 0, 2, 3, 0, 0])
示例#3
0
 def test_rating_dist(self):
     dist, labels = Profile.rating_dist(self.dataset, stacks=6, stack_range=1)
     self.assertEqual(len(labels), 6)
     self.assertEqual(len(dist), 6)
     self.assertEqual(dist.tolist(), [0, 6, 0, 1, 3, 3])