-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG] Simplify addition of point (0, 0) in roc_curve #13523
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
[MRG] Simplify addition of point (0, 0) in roc_curve #13523
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
sklearn/metrics/ranking.py
Outdated
tps = np.r_[0, tps] | ||
fps = np.r_[0, fps] | ||
thresholds = np.r_[thresholds[0] + 1, thresholds] | ||
# Add an extra threshold position if necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess then remove the "if necessary" part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, thanks ! Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wdevazelhes
* first commit * remove "if necessary"
…arn#13523)" This reverts commit 3c8bdf1.
…arn#13523)" This reverts commit 3c8bdf1.
* first commit * remove "if necessary"
After the modification of #10093, I think we can simplify the code because it's forced that we pass in one of the case tested by the "if":
tps.size == 0
then we pass in ittps
and one element infps
(tps
andfps
have the same size)Then the first point is the first classified positive so it's either a true positive or a false positive. So I think we should pass in the "if" statement in any case