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

Skip to content

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
@github-actions
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
lucyleeow pushed a commit to lucyleeow/scikit-learn that referenced this pull request Aug 22, 2025
…ction) (scikit-learn#15504)

Co-authored-by: Lakshmi Krishnan <[email protected]>
Co-authored-by: Jérémie du Boisberranger <[email protected]>
@jeremiedbb jeremiedbb mentioned this pull request Sep 3, 2025
13 tasks
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