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

Skip to content

Conversation

@pidefrem
Copy link
Contributor

@pidefrem pidefrem commented Jan 2, 2024

Reference Issues/PRs

Fixes #28050

What does this implement/fix? Explain your changes.

Optimizing the function _check_pos_label_consistency when the argument pos_label is not None by avoiding the apply np.unique to the classes.

Any other comments?

@github-actions
Copy link

github-actions bot commented Jan 2, 2024

✔️ Linting Passed

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

Generated for commit: e2e904f. Link to the linter CI: here

@thomasjpfan thomasjpfan changed the title Optimize function utils.validation._check_pos_label_consistency EFF Optimize function utils.validation._check_pos_label_consistency Jan 3, 2024
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! Overall looks good.

Please add an entry to the change log at doc/whats_new/v1.5.rst with tag |Efficiency|. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

The changelog is public facing and _check_pos_label_consistency is a private function. Your changelog entry should reference public functions that are now more efficient: calibration_curve, brier_score_loss, precision_recall_curve, det_curve, roc_curve.

@pidefrem
Copy link
Contributor Author

pidefrem commented Jan 3, 2024

Thank you @thomasjpfan for your review! I just added the changes you suggested.

@pidefrem pidefrem force-pushed the 28050-optimize-utils-validation-_check_pos_label_consistency branch from 09956cc to 884cb07 Compare January 3, 2024 11:09
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @pidefrem

@glemaitre glemaitre merged commit fee76cc into scikit-learn:main Jan 11, 2024
@pidefrem pidefrem deleted the 28050-optimize-utils-validation-_check_pos_label_consistency branch January 11, 2024 23:12
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 10, 2024
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.

function _check_pos_label_consistency() applies np.unique() to y_true even if pos_label is not None

3 participants