예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))
예제 #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)
예제 #7
0
 def test_batchT_GetNumberOfTargets(self):
     y = [[1, 2], [3, 4], [5, 6]]
     _, targets = batchT(y)
     self.assertEqual(2, targets)
예제 #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))
예제 #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)
예제 #10
0
 def test_batchT_GetNumberOfTargets(self):
     y = [[1, 2], [3, 4], [5, 6]]
     _, targets = batchT(y)
     self.assertEqual(2, targets)