Skip to content

[MRG] BUG: enforce row-wise arg max of decision function=predicted class #15504

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 4 commits into from
Jul 25, 2025

Conversation

lakrish
Copy link
Contributor

@lakrish lakrish commented Nov 2, 2019

Reference Issues/PRs

Fixes #14124

What does this implement/fix? Explain your changes.

The estimators are traversed in reversed order to be consistent with the value returned on arg-max of decision function.

Any other comments?

The reproducer in the original issue, now runs successfully.

@lakrish lakrish changed the title BUG: enforce row-wise arg max of decision function=predicted class [MRG] BUG: enforce row-wise arg max of decision function=predicted class Nov 2, 2019
@eickenberg
Copy link
Contributor

The changes look good to me.

Is there a test associated with this already?

If not, you can take the code from the issue you reference, turn it into a test, make sure it fails before this change, and make sure it passes after the change.

@lakrish
Copy link
Contributor Author

lakrish commented Nov 2, 2019

I believe there is already a test set up here: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tests/test_multiclass.py#L218

@eickenberg
Copy link
Contributor

eickenberg commented Nov 2, 2019

Did it fail before this fix?

(Ideally you want to write a test that fails before your fix, and then passes after your fix)

@lakrish
Copy link
Contributor Author

lakrish commented Nov 2, 2019

I added a small test that fails without the fix.

@amueller
Copy link
Member

this is still waiting for reviews, right?

Base automatically changed from master to main January 22, 2021 10:51
Copy link

✔️ Linting Passed

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

Generated for commit: 20da066. Link to the linter CI: here

Copy link
Member

@jeremiedbb jeremiedbb 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

@jeremiedbb jeremiedbb enabled auto-merge (squash) July 25, 2025 22:20
@jeremiedbb jeremiedbb merged commit ed5f530 into scikit-learn:main Jul 25, 2025
36 checks passed
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.

OneVsRestClassifier violates predict(X)==argmax(decision_function)
5 participants