-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
average_precision_score breaks on string labels #12312
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
Comments
I think this bug was introduced in #9980, ping @qinhanmin2014. |
Thanks for the issue and apologies for the inconvenience. Some quick replies, will further investigate and fix this one later this day: |
Regarding the nan issue, we have a PR #8280. I can take that one but before that @amueller , I want your decision about the edge cases of precision & recall. |
I'm not sure what we should advise. We could ask users also to just do |
I'm not sure what you mean by "the nan issue". |
The nan issue means that if we only have negative classes in y_true, we'll get nan (along with a warning). The issue here is whether we allow metrics & scorers to output nan and how to solve it.
Apologies I don't understand here. I think we add pos_label here so that users don't need to do things like I've added the error message in #12313. If you think the nan output you got in this issue is fine, then that PR will close this issue. |
Well doing |
I feel like all the issues I raised are fixed by #12313. But it's still awkward to actually use this with the scorer interface and I'm not sure what we should be suggesting. |
If you don't like Seems that you don't worry about getting nan, so I'm going to close this one. For pos_label related discussions, we have an issue #10010. Reopen if you disagree. |
no I think this is good. |
Uh oh!
There was an error while loading. Please reload this page.
That's not very helpful.Fixed in #12313Casting to dtype object (as coming from pandas):
That's terrible....Fixed in #12313What I actually did was
that's also terrible...
Originally I used cross-validation, which is arguably worse:
The text was updated successfully, but these errors were encountered: