diff --git a/sklearn/preprocessing/_function_transformer.py b/sklearn/preprocessing/_function_transformer.py index c49684d0ebfbc..76fd94b54cf43 100644 --- a/sklearn/preprocessing/_function_transformer.py +++ b/sklearn/preprocessing/_function_transformer.py @@ -194,7 +194,7 @@ def _check_inverse_transform(self, X): if not all(np.issubdtype(d, np.number) for d in dtypes): raise ValueError( - "'check_inverse' is only supported when all the elements in `X` is" + "'check_inverse' is only supported when all the elements in `X` are" " numerical." ) diff --git a/sklearn/preprocessing/tests/test_function_transformer.py b/sklearn/preprocessing/tests/test_function_transformer.py index 81d9d0b8eb843..792e766858fea 100644 --- a/sklearn/preprocessing/tests/test_function_transformer.py +++ b/sklearn/preprocessing/tests/test_function_transformer.py @@ -209,7 +209,7 @@ def inverse_func(X): func=func, inverse_func=inverse_func, validate=False, check_inverse=True ) - msg = "'check_inverse' is only supported when all the elements in `X` is numerical." + msg = "'check_inverse' is only supported when all the elements in `X` are numerical." with pytest.raises(ValueError, match=msg): transformer.fit(data) @@ -239,7 +239,7 @@ def test_function_transformer_with_dataframe_and_check_inverse_True(): ) df_mixed = pd.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]}) - msg = "'check_inverse' is only supported when all the elements in `X` is numerical." + msg = "'check_inverse' is only supported when all the elements in `X` are numerical." with pytest.raises(ValueError, match=msg): transformer.fit(df_mixed)