Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT Deprecate None option in pos_label for precison/recall/f1 and jaccard metrics #27762

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

Closed
wants to merge 2 commits into from

Conversation

lucyleeow
Copy link
Member

@lucyleeow lucyleeow commented Nov 10, 2023

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 for pos_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 use average != 'binary' (ref). Now pos_label is just ignored if average != 'binary', so you no longer need to worry about setting pos_label to any specific value.

pos_label is only used if average='binary' and in this case setting pos_label=None will raise an error.

The documentation of the None option has been (mostly) removed long ago in this commit. Removing support for None 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

@lucyleeow lucyleeow changed the title dep pos_label None Deprecate None option in pos_label for precisoon/recall/f1 and jaccard metrics Nov 10, 2023
@lucyleeow lucyleeow changed the title Deprecate None option in pos_label for precisoon/recall/f1 and jaccard metrics MAINT Deprecate None option in pos_label for precison/recall/f1 and jaccard metrics Nov 10, 2023
Copy link

github-actions bot commented Nov 10, 2023

✔️ Linting Passed

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

Generated for commit: 9eb2620. Link to the linter CI: here

@lucyleeow
Copy link
Member Author

Closing, see discussion here: #10010 (comment)

@lucyleeow lucyleeow closed this Nov 28, 2023
@lucyleeow lucyleeow deleted the rm_none_poslabel_prf branch November 28, 2023 01:44
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