def test_chrono_item_data(self): zero_data = [] for idx in range(len(self.triplet_data)): u = self.triplet_data[idx][0] i = self.triplet_data[-1-idx][1] zero_data.append((u, i, 1., 0)) train_set = Dataset.from_uirt(self.uirt_data + zero_data) self.assertEqual(len(train_set.chrono_item_data), 10) self.assertListEqual(train_set.chrono_item_data[0][1], [1., 4.]) self.assertListEqual(train_set.chrono_item_data[0][2], [0, 882606572]) try: Dataset.from_uir(self.triplet_data).chrono_item_data except ValueError: assert True
def test_from_uirt(self): train_set = Dataset.from_uirt(self.uirt_data) self.assertTrue(len(train_set.timestamps) == 10)