ENH add from_cv_results in RocCurveDisplay (list of displays)#30370
Closed
lucyleeow wants to merge 3 commits intoscikit-learn:mainfrom
Closed
ENH add from_cv_results in RocCurveDisplay (list of displays)#30370lucyleeow wants to merge 3 commits intoscikit-learn:mainfrom
lucyleeow wants to merge 3 commits intoscikit-learn:mainfrom
Conversation
lucyleeow
commented
Nov 29, 2024
Comment on lines
+567
to
+570
| # Ideally we would use `_validate_plot_params` but that is a instance | ||
| # method | ||
| check_matplotlib_support(f"{cls.__class__.__name__}.plot") | ||
| import matplotlib.pyplot as plt |
Member
Author
There was a problem hiding this comment.
The _BinaryClassifierCurveDisplayMixin method _validate_plot_params, is an instance method which uses self, which means we can't use it here.
Not sure how much of a problem this is.
Member
Author
|
From discussion last week, implementation wise, this is 'simplest' but the output is a list which is difficult for the user to work with, e.g., if they wanted to create the plot again they would have to iterate through the list, which would also change default line settings. |
Member
Author
|
closing in favour of #30399 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Supercedes #25939
This is part of a group of draft PRs to determine best API for adding plots for cv results to our displays.
from_cv_resultsinRocCurveDisplay(Multi-display) #30359)from_cv_resultsinRocCurveDisplay(singleRocCurveDisplay) #30399)For all 3 options we take the output of
cross_validate, and use the fitted estimator and test indicies. No fitting is done in the display.We do recalculate the predictions (which would have already been done in
cross_validate), which could be avoided if we decided to changecross_validateto optionally return the predictions as well (note this would makecross_val_predictredundant).See more thread: #25939 (comment)). I think should be outside of the scope of this body of work though.
What does this implement/fix? Explain your changes.
Adds
from_cv_resultswhich returns a list ofRocCurveDisplay's, one for each fold.I like this implementation. There is one small problem I'll detail in a review comment.
Any other comments?
Plot looks like (should be the same as the other PRs):