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

Skip to content

[API, MAINT] Deprecate usage of y_prob and probas_pred in sklearn.metrics #28092

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

Merged
merged 29 commits into from
Feb 16, 2024

Conversation

adam2392
Copy link
Member

Reference Issues/PRs

Fixes: #27994

What does this implement/fix? Explain your changes.

Consolidates usage of y_score or y_proba.

Any other comments?

Signed-off-by: Adam Li <[email protected]>
Signed-off-by: Adam Li <[email protected]>
Copy link

github-actions bot commented Jan 10, 2024

✔️ Linting Passed

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

Generated for commit: 62dc74e. Link to the linter CI: here

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

All versions need to be bumped by 1

Otherwise LGTM.

Comment on lines 3137 to 3140
"y_proba": ["array-like", None],
"sample_weight": ["array-like", None],
"pos_label": [Real, str, "boolean", None],
"y_prob": ["array-like", StrOptions({"deprecated"})],
Copy link
Member

Choose a reason for hiding this comment

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

None and "deprecated" both need to be a hidden option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines 868 to 874
"y_score": ["array-like", None],
"pos_label": [Real, str, "boolean", None],
"sample_weight": ["array-like", None],
"drop_intermediate": ["boolean"],
"probas_pred": [
"array-like",
StrOptions({"deprecated"}),
Copy link
Member

Choose a reason for hiding this comment

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

same here, hidden options.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member Author

@adam2392 adam2392 left a comment

Choose a reason for hiding this comment

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

Addressed your comments. Thanks @adrinjalali !

Comment on lines 3137 to 3140
"y_proba": ["array-like", None],
"sample_weight": ["array-like", None],
"pos_label": [Real, str, "boolean", None],
"y_prob": ["array-like", StrOptions({"deprecated"})],
Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Comment on lines 868 to 874
"y_score": ["array-like", None],
"pos_label": [Real, str, "boolean", None],
"sample_weight": ["array-like", None],
"drop_intermediate": ["boolean"],
"probas_pred": [
"array-like",
StrOptions({"deprecated"}),
Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@adam2392 adam2392 requested a review from adrinjalali January 25, 2024 18:39
Copy link
Member

@adrinjalali adrinjalali 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 @adam2392

@adrinjalali
Copy link
Member

@glemaitre this should be a quick review.

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 @adam2392 !

@adam2392
Copy link
Member Author

Thank you for the review!

Signed-off-by: Adam Li <[email protected]>
@thomasjpfan
Copy link
Member

The CI failures look related.

@adam2392
Copy link
Member Author

The CI failures look related.

Ah yes. The check needed to handle various edge cases properly since the variable can be an array, or a string. It should be fixed hopefully now...

Signed-off-by: Adam Li <[email protected]>
Signed-off-by: Adam Li <[email protected]>
@adam2392 adam2392 requested a review from thomasjpfan February 16, 2024 17:40
@thomasjpfan thomasjpfan merged commit 0b0bddd into scikit-learn:main Feb 16, 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.

Consolidation of the naming of y_pred_proba, y_score vs probas_pred
3 participants