def test_ClassificationStrings_CreateTargets(self): y = ['cat', 'cat', 'dog', 'mouse'] cdict = c_dictT(y) y1 = np.vstack(batchT(y, c_dict=cdict)[0]) self.assertTrue(y1.shape[0] == 4) self.assertTrue(y1.shape[1] == 3) self.assertTrue(np.all(y1.sum(1) == 1))
def test_ClassificationY_CreateTargets(self): y = np.array([1, 1, 2, 3]) cdict = c_dictT(y) y1 = np.vstack(batchT(y, c_dict=cdict)[0]) self.assertTrue(y1.shape[0] == 4) self.assertTrue(y1.shape[1] == 3) self.assertTrue(np.all(y1.sum(1) == 1))
def test_batchT_NumberOfClassificationTargets(self): y = ['cat', 'cat', 'dog', 'mouse'] cdict = c_dictT(y) _, ctargets = batchT(y, c_dict=cdict) self.assertEqual(3, ctargets)