-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
MNT Handle NaNs in scipy dev rankdata #24141
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
Conversation
There was a problem hiding this 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 fix. LGTM
I removed the "Breaking Change" label because this preserves the behavior in scikit-learn when SciPy 1.10 is released. In a sense, this PR is fixing something in scikit-learn that would have been broken. |
OK, I added them regarding @lesteve's last remark:
|
As for @lesteve's comment, we can think about backporting this change to 1.1.3 so that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @lesteve. Let's add a changelog entry targeting scikit-learn 1.2.
I we ever decide to backport this to 1.1.3 we will move the entry then.
OK I have added a what's new entry |
Thanks for the fix! |
Great, the scipy-dev build may be green tomorrow morning which hasn't happened in a while 🤞 |
One of the failure in the scipy-dev build #23626 (turns out it fixes all the scipy-dev failures for some reason ...)
This is a change in scipy 1.10.dev: scipy/scipy#16140
scipy 1.10.dev:
array([ 1., 2., nan])
scipy 1.9:
array([ 1., 2., 3.])
Note: the change in scipy breaks backward-compatibility for the rank in the
cv_results_
attribute. For nan scores, the associated rank will benp.iinfo(np.int32).min
i.e.-2147483648
. I am not sure how much the ranks are used in general (I would guess not used very much) and how acceptable such a breaking change is.