Skip to content
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

ENH add from_cv_results in RocCurveDisplay (list of displays) #30370

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lucyleeow
Copy link
Member

@lucyleeow lucyleeow commented Nov 29, 2024

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.

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 change cross_validate to optionally return the predictions as well (note this would make cross_val_predict redundant).
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_results which returns a list of RocCurveDisplay'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):

image

Copy link

github-actions bot commented Nov 29, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: c7966bf. Link to the linter CI: here

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant