MNT Moving _CurveScorer from model_selection to metrics#29216
Merged
jeremiedbb merged 4 commits intoscikit-learn:mainfrom Jul 25, 2024
Merged
MNT Moving _CurveScorer from model_selection to metrics#29216jeremiedbb merged 4 commits intoscikit-learn:mainfrom
_CurveScorer from model_selection to metrics#29216jeremiedbb merged 4 commits intoscikit-learn:mainfrom
Conversation
7 tasks
glemaitre
reviewed
Jun 20, 2024
| return classes[map_thresholded_score_to_label[(y_score >= threshold).astype(int)]] | ||
|
|
||
|
|
||
| class _CurveScorer(_BaseScorer): |
Member
There was a problem hiding this comment.
I think that we should move those in the _score.py file. We already have the _Scorer there.
Contributor
Author
There was a problem hiding this comment.
I created this file because I thought that it made sense to have the new function to live here. But I'll move it.
Side question: do you think that sklearn.metrics.decision_threshold_curve should also be inside _score.py?
glemaitre
reviewed
Jul 25, 2024
Member
glemaitre
left a comment
There was a problem hiding this comment.
do you think that sklearn.metrics.decision_threshold_curve should also be inside _score.py
I'm not sure yet. I think that we are going to assess it. Since it will linked to plot, it will have its dedicated file.
MarcBresson
pushed a commit
to MarcBresson/scikit-learn
that referenced
this pull request
Sep 2, 2024
…-learn#29216) Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
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.
Towards #25639.
As we'll be leveraging the code of
sklearn.model_selection._classification_threshold._CurveScorerinto the implementation of the proposedsklearn.metrics.decision_threshold_curve, it makes sense to move the_CurveScorertometricsas asked by @glemaitre in this comment.This PR moves the code of
_CurveScorerand_threshold_scores_to_class_labelsand the tests to the new location.