API add from_estimator and from_preditions to PrecisionRecallDisplay#20552
Conversation
| @@ -0,0 +1,138 @@ | |||
| import pytest | |||
There was a problem hiding this comment.
Note to reviewer: this test will be used as well for the RocCurveDisplay and the DetCurveDisplay
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you for working on this @glemaitre !
Few comments, otherwise LGTM.
rth
left a comment
There was a problem hiding this comment.
Thanks! Could you please resolve merge conflicts? I'll review tests when that is done..
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
…Display' into class_methods_PrecisionRecallDisplay
rth
left a comment
There was a problem hiding this comment.
Generally LGTM. Not sure why codecov doesn't show in CI, but the report is in https://app.codecov.io/gh/scikit-learn/scikit-learn/compare/20552
| @@ -144,7 +152,206 @@ def plot(self, ax=None, *, name=None, **kwargs): | |||
| self.figure_ = ax.figure | |||
| return self | |||
There was a problem hiding this comment.
I still find it counter-intuitive that plot returns self instead of ax, but that's unrelated to this PR
There was a problem hiding this comment.
I don't really recall if there is any reason. Maybe it allows pipelining some operations but it is true that pandas/seaborn usually return an axis
|
There is 2 approvals here to I will merge this one to fix the conflict in #20569 |
…cikit-learn#20552) Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Address some of #15880
Add the class methods
from_estimatorandfrom_predictionsto the classPrecisionRecallDisplay. In addition, we deprecate theplot_precision_recall_curvein favour of these two class methods.TODO: