Skip to content

API add from_estimator and from_predictions to RocCurveDisplay - #20569

Merged
ogrisel merged 21 commits into
scikit-learn:mainfrom
glemaitre:api_RocCurveDisplay
Sep 3, 2021
Merged

ogrisel merged 21 commits into
scikit-learn:mainfrom
glemaitre:api_RocCurveDisplay

Conversation

@glemaitre

@glemaitre glemaitre commented Jul 19, 2021 •

Copy link
Copy Markdown
Member

Address some of #15880

Add from_estimator and from_predictions method and deprecate the plot_roc_curve.

TODO:

  • Add new class methods
  • Deprecate plot_roc_curve
  • Add check for raising deprecation warnings
  • Catch deprecation warning in test
  • Add common test for the curve
  • Add tests for the display
  • Update the examples
  • Update the user guide

@glemaitre
glemaitre marked this pull request as ready for review July 20, 2021 08:02

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good.

How should we handle the release hightlights for 0.22?

svc_disp = plot_roc_curve(svc, X_test, y_test)
rfc_disp = plot_roc_curve(rfc, X_test, y_test, ax=svc_disp.ax_)
rfc_disp.figure_.suptitle("ROC curve comparison")

I guess we can comment out the deprecated code, use from_estimator and add a comment?

@glemaitre

Copy link
Copy Markdown
Member Author

I guess we can comment out the deprecated code, use from_estimator and add a comment?

I would delay the change for when we will remove the function. But I assume that commenting will be the only way to manage these issues.

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small comment, otherwise LGTM!

Comment thread doc/developers/plotting.rst Resolved
Comment thread doc/developers/plotting.rst Resolved
Comment thread sklearn/metrics/_plot/roc_curve.py Resolved

@adrinjalali adrinjalali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@scikit-learn/core-devs this needs another review if it's going to be in the release. I'd like to call a feature freeze on Monday.

Comment thread doc/visualizations.rst Resolved

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks very good. Thanks @glemaitre!

Comment thread doc/developers/plotting.rst Resolved
@pytest.fixture(scope="module")
def data_binary(data):
X, y = data
return X[y < 2], y[y < 2]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice use of module-scoped fixtures.

@ogrisel
ogrisel merged commit f461908 into scikit-learn:main Sep 3, 2021
adrinjalali added a commit to adrinjalali/scikit-learn that referenced this pull request Sep 5, 2021
…t-learn#20569)

Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
adrinjalali added a commit to adrinjalali/scikit-learn that referenced this pull request Sep 5, 2021
…t-learn#20569)

Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
adrinjalali added a commit that referenced this pull request Sep 6, 2021
Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…t-learn#20569)

Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Adrin Jalali <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
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.

4 participants