def test_equalize_class_distribution_valid_data_ordered(self): X = [[0], [1], [2], [3], [4], [5]] y = [1, 2, 1, 2, 1, 1] X, y = chest_accel.equalize_class_distribution(X, y) expected_X = np.array([[0], [1], [2], [3]]) expected_y = np.array([1, 2, 1, 2]) self.assertTrue(np.array_equal(X, expected_X)) self.assertTrue(np.array_equal(y, expected_y))
def test_equalize_class_distribution_valid_data_unordered(self): X = [[0], [1], [2], [3], [4], [5], [6]] y = [1, 2, 1, 2, 1, 1, 2] X, y = chest_accel.equalize_class_distribution(X, y) expected_X = np.array([[0], [1], [2], [3], [4], [6]]) expected_y = np.array([1, 2, 1, 2, 1, 2]) self.assertTrue(np.array_equal(X, expected_X)) self.assertTrue(np.array_equal(y, expected_y))
def test_equalize_class_distribution_invalid_data(self): X = [] y = [] X, y = chest_accel.equalize_class_distribution(X, y) self.assertTrue(np.array_equal(X, np.array([]))) self.assertTrue(np.array_equal(y, np.array([])))