(self)
| 28 | class IrisDataTest(unittest.TestCase): |
| 29 | |
| 30 | def testLoadData(self): |
| 31 | iris_x, iris_y = iris_data.load() |
| 32 | self.assertEqual(2, len(iris_x.shape)) |
| 33 | self.assertGreater(iris_x.shape[0], 0) |
| 34 | self.assertEqual(4, iris_x.shape[1]) |
| 35 | self.assertEqual(iris_x.shape[0], iris_y.shape[0]) |
| 36 | self.assertEqual(3, iris_y.shape[1]) |
| 37 | self.assertTrue( |
| 38 | np.allclose(np.ones([iris_y.shape[0], 1]), np.sum(iris_y, axis=1))) |
| 39 | |
| 40 | |
| 41 | if __name__ == '__main__': |