def test_contains_type(self): d = Dataset(self.X, self.y, self.data_info, '?', '%Y-%m-%d', True) self.assertEqual(d.contains_type('numeric'), True) self.assertEqual(d.contains_type('string'), False) d.remove_type('numeric') self.assertEqual(d.contains_type('numeric'), False)
def test_remove_type(self): d = Dataset(self.X, self.y, self.data_info, '?', '%Y-%m-%d', True) d.remove_type('nominal') expected_X = np.array([[1.0, 0.5, 1355266800.0], [1.0, 0.5, 1355266800.0], [1.0, 0, 1385161200.0], [1.0, 0.5, 1326236400.0], [0, 0.5, 955749600.0]]) expected_data_info = ['numeric', 'numeric', 'timestamp'] np.testing.assert_equal(d.X, expected_X) np.testing.assert_equal(d.data_info, expected_data_info)