Skip to content

Commit

Permalink
DOC Typo in the error message of _binary_clf_curve (scikit-learn#15703)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhanmin2014 authored and Pan Jan committed Mar 3, 2020
1 parent 62b11e8 commit 6ea083b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sklearn/metrics/_ranking.py
Expand Up @@ -539,7 +539,7 @@ def _binary_clf_curve(y_true, y_score, pos_label=None, sample_weight=None):
classes_repr = ", ".join(repr(c) for c in classes)
raise ValueError("y_true takes value in {{{classes_repr}}} and "
"pos_label is not specified: either make y_true "
"take integer value in {{0, 1}} or {{-1, 1}} or "
"take value in {{0, 1}} or {{-1, 1}} or "
"pass pos_label explicitly.".format(
classes_repr=classes_repr))
elif pos_label is None:
Expand Down
4 changes: 2 additions & 2 deletions sklearn/metrics/tests/test_ranking.py
Expand Up @@ -683,7 +683,7 @@ def test_binary_clf_curve_implicit_pos_label(curve_func):
# Check that using string class labels raises an informative
# error for any supported string dtype:
msg = ("y_true takes value in {'a', 'b'} and pos_label is "
"not specified: either make y_true take integer "
"not specified: either make y_true take "
"value in {0, 1} or {-1, 1} or pass pos_label "
"explicitly.")
with pytest.raises(ValueError, match=msg):
Expand All @@ -695,7 +695,7 @@ def test_binary_clf_curve_implicit_pos_label(curve_func):
# The error message is slightly different for bytes-encoded
# class labels, but otherwise the behavior is the same:
msg = ("y_true takes value in {b'a', b'b'} and pos_label is "
"not specified: either make y_true take integer "
"not specified: either make y_true take "
"value in {0, 1} or {-1, 1} or pass pos_label "
"explicitly.")
with pytest.raises(ValueError, match=msg):
Expand Down

0 comments on commit 6ea083b

Please sign in to comment.