Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
 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))
Exemplo n.º 4
0
 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))
Exemplo n.º 5
0
 def test_OneDimensionalY_ReshapeY(self):
     y1 = np.array([4, 5, 6])
     y2 = np.array([[4], [5], [6]])
     y1p = np.vstack(batchT(y1)[0])
     self.assertEqual(y2.shape, y1p.shape)
     self.assertTrue(np.allclose(y2, y1p))
Exemplo n.º 6
0
 def test_batchT_NumberOfClassificationTargets(self):
     y = ['cat', 'cat', 'dog', 'mouse']
     cdict = c_dictT(y)
     _, ctargets = batchT(y, c_dict=cdict)
     self.assertEqual(3, ctargets)
Exemplo n.º 7
0
 def test_batchT_GetNumberOfTargets(self):
     y = [[1, 2], [3, 4], [5, 6]]
     _, targets = batchT(y)
     self.assertEqual(2, targets)
Exemplo n.º 8
0
 def test_OneDimensionalY_ReshapeY(self):
     y1 = np.array([4, 5, 6])
     y2 = np.array([[4], [5], [6]])
     y1p = np.vstack(batchT(y1)[0])
     self.assertEqual(y2.shape, y1p.shape)
     self.assertTrue(np.allclose(y2, y1p))
Exemplo n.º 9
0
 def test_batchT_NumberOfClassificationTargets(self):
     y = ['cat', 'cat', 'dog', 'mouse']
     cdict = c_dictT(y)
     _, ctargets = batchT(y, c_dict=cdict)
     self.assertEqual(3, ctargets)
Exemplo n.º 10
0
 def test_batchT_GetNumberOfTargets(self):
     y = [[1, 2], [3, 4], [5, 6]]
     _, targets = batchT(y)
     self.assertEqual(2, targets)