-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG] Ensure that ROC curve starts at (0, 0) #10093
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
Conversation
Looks good at a glance. Please add to what's new. Can this change affect the auc? If so, document carefully. Also, perhaps add that reference on roc analysis to the docs |
@jnothman Thanks a lot for the instant review :) |
LGTM |
@@ -160,6 +161,11 @@ Metrics | |||
- Fixed a bug due to floating point error in :func:`metrics.roc_auc_score` with | |||
non-integer sample weights. :issue:`9786` by :user:`Hanmin Qin <qinhanmin2014>`. | |||
|
|||
- Fixed a bug where :func:`metrics.roc_curve` sometimes starts on y-axis instead | |||
of (0, 0), which is inconsistent with the document and other implementations. |
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.
Note that this does not affect auc
@jnothman Thanks. Comment addressed. |
I don't think this is controversial: I'll take Joan's +1 on this... Let's merge. Thanks! |
Reference Issues/PRs
Fixes #9790
See also #9850
What does this implement/fix? Explain your changes.
Currently, when the first point of ROC curve is on y-axis, we don't add a point (0, 0), which is not consistent with doc & some papers & some R packages.
Reference:
(1)scikit-learn doc
thresholds : array, shape = [n_thresholds]
Decreasing thresholds on the decision function used to compute fpr and tpr. thresholds[0] represents no instances being predicted and is arbitrarily set to max(y_score) + 1.
(2)@jnothman's comment
our concern should be that in all cases, the curve includes a point that represents predicting nothing in the positive class, and that every further point represents predicting more than nothing, for every threshold at which this changes the fpr or tpr, until all are predicted.
(3)An introduction to ROC analysis cite >7000 link
(4)R package ROCR
Any other comments?