MAINT Deprecate None
option in pos_label
for precison/recall/f1 and jaccard metrics
#27762
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
Towards #10010 - removal of
pos_label=None
as it is ill-defined and inconsistently implemented.What does this implement/fix? Explain your changes.
Deprecate
None
option forpos_label
in functions:precision_recall_fscore_support
/f1_score
/fbeta_score
/precision_score
/recall_score
jaccard_score
Prior to v0.18 you needed to set
pos_label=None
if targets were binary but you wanted to useaverage != 'binary'
(ref). Nowpos_label
is just ignored ifaverage != 'binary'
, so you no longer need to worry about settingpos_label
to any specific value.pos_label
is only used ifaverage='binary'
and in this case settingpos_label=None
will raise an error.The documentation of the
None
option has been (mostly) removed long ago in this commit. Removing support forNone
has been suggested previously: https://github.com/scikit-learn/scikit-learn/pull/13151/files#r262034515 but thought not suitable in that PR.Any other comments?
Not sure what is the procedure for deprecating a parameter option (not yet in the deprecation docs). This was just a guess, am happy to make any changes.
related: #27714