def test_Y_ndarray_bad_columns(self, transformX, transformA, A_two_dim): gs = GridSearch(self.estimator, self.disparity_criterion) X, Y, A = _quick_data(A_two_dim) Y_two_col_ndarray = np.stack((Y, Y), -1) with pytest.raises(ValueError) as execInfo: gs.fit(transformX(X), Y_two_col_ndarray, sensitive_features=transformA(A)) assert get_sklearn_expected_1d_message() in execInfo.value.args[0]
def test_Y_df_bad_columns(self, transformX, transformA, A_two_dim): gs = GridSearch(self.estimator, self.disparity_criterion) X, Y, A = _quick_data(A_two_dim) Y_two_col_df = pd.DataFrame({"a": Y, "b": Y}) with pytest.raises(ValueError) as execInfo: gs.fit(transformX(X), Y_two_col_df, sensitive_features=transformA(A)) assert get_sklearn_expected_1d_message() in execInfo.value.args[0]