Repository navigation
DOC Fix response values shape - #32918
Merged
thomasjpfan merged 3 commits intoDec 22, 2025
Merged
Conversation
AnneBeyer
commented
Dec 17, 2025
| (LogisticRegression(), "predict", "binary", (10,)), | ||
| (LogisticRegression(), "predict_proba", "binary", (10,)), | ||
| (LogisticRegression(), "decision_function", "binary", (10,)), | ||
| (LogisticRegression(), "predict", "multiclass", (10,)), |
Member
Author
There was a problem hiding this comment.
This is the test that was inconsistent with the previous version of the docstring (which suggested that it should be (10,4))
thomasjpfan
reviewed
Dec 20, 2025
| if target_type == "binary": | ||
| y = np.array([0, 1] * 5) | ||
| elif target_type == "multiclass": | ||
| y = np.arange(10) |
Member
There was a problem hiding this comment.
Can the test values for y be something like [0, 1, 2, 3, 0, 1, 2, 3, 3, 0] so that the test would check for (10, 4) for the multi-class + predict_proba case?
This makes it more obvious that n_samples and n_classes can be different values.
virchan
approved these changes
Dec 22, 2025
virchan
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks, @AnneBeyer!
@thomasjpfan, could we merge this?
2 of 4 tasks
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.
Reference Issues/PRs
Towards #32872
What does this implement/fix? Explain your changes.
The problem in #32872 arises from the assumption that multiclass classification will have a different output shape than binary classification, which is not the case when
response_method="predict".To make sure, I added a test for all output shapes and updated the docstring according to the result.
AI usage disclosure
I used AI assistance for:
Any other comments?
I have not checked if this assumption is used anywhere else.