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

DOC Typo in the error message of _binary_clf_curve #15703

Merged

Conversation

qinhanmin2014
Copy link
Member

Typo in #15562, we support float y_true and it's tested.
ping @ogrisel @thomasjpfan

@qinhanmin2014 qinhanmin2014 added this to the 0.22 milestone Nov 22, 2019
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

@NicolasHug
Copy link
Member

We accept a float dtype, but we don't accept real numbers, right?

Saying a value should be an integer is different from saying it should be of type int, so I think the current docstrings are correct.

i.e. math domain != type

@qinhanmin2014
Copy link
Member Author

Well @NicolasHug you can close this if you think current version is okay, but I'd argue that it's misleading. What's more, the author of the original PR has approved this PR.

@@ -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 "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single brackets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry what do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{} instead of {{}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NicolasHug We can't use {} here because {} has special meaning. We need to use {{}} to output {}.

@NicolasHug
Copy link
Member

I don't think it's misleading, but I don't mind

@qinhanmin2014
Copy link
Member Author

I'm going to merge because the author of the original PR approved it, and Nicolas is not opposed to it.

@qinhanmin2014 qinhanmin2014 merged commit 63cd600 into scikit-learn:master Nov 26, 2019
adrinjalali pushed a commit to adrinjalali/scikit-learn that referenced this pull request Nov 27, 2019
@qinhanmin2014 qinhanmin2014 deleted the binary_clf_curve_typo branch December 6, 2019 04:06
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants