Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected grammar in error message #28973

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sklearn/preprocessing/_function_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)

Expand Down
4 changes: 2 additions & 2 deletions sklearn/preprocessing/tests/test_function_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down