-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
DOC Rework plot_roc.py example #24200
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
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.
Hi @ArturoAmorQ, thanks for your work.
I've made some comments, mainly about the format.
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.
Here is a partial review. More to come in a few days hopefully.
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Chiara Marmo <[email protected]>
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 think that we can state that the example is much better :)
I really like the narrative, I find it intuitive.
I put some nitpicking that could clarify the code.
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
# Interpolate all ROC curves at these points | ||
mean_tpr = np.zeros_like(fpr_grid) | ||
|
||
for i in range(n_classes): |
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.
If you don't want to use sp.interpolate.interp1d
then we should add a comment that interp
is doing linear interpolation. Another downside of using interp
is that values need to be ordered.
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 am hesitating about what is the best, as we actually use np.interp
to compute the tpr in the private function _binary_roc_auc_score
. Also it would add boilerplate code below. Maybe the easiest is to indeed add a comment on linear interpolation.
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
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 @ArturoAmorQ for refactoring and polishing this example. It really looks good. Just a few more suggestions below:
Co-authored-by: Olivier Grisel <[email protected]>
What is missing so this could be merged? |
I still have to tweak the plot legends to reduce their overlapping with the figure, I just haven't had the time. But (hopefully) this will be ready to merge soon ;) thanks for your interest, @haiatn! |
Thanks @ArturoAmorQ LGTM. |
Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Chiara Marmo <[email protected]> Co-authored-by: Guillaume Lemaitre <[email protected]>
Reference Issues/PRs
Fixes #13546.
Fixes #24288.
Takes #24192 into account.
What does this implement/fix? Explain your changes.
As discussed in #13546, the current state of the
roc_plot.py
example gives different macro-averaged AUC thanroc_auc_score
because they use different averaging strategies. This PR aims to clarifying the different averaging strategies by implementing a "tutorialization".Any other comments?
Side effect: Implements notebook style as intended in #22406.