-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix deprecation warning force_all_finite -> ensure_all_finite for sklearn>=1.6 #206
Fix deprecation warning force_all_finite -> ensure_all_finite for sklearn>=1.6 #206
Conversation
Hi @icarosadero , thanks a lot for fixing! Do you happen to know when the |
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.
ok so it seems that this is indeed an issue also for recent versions of scikit-learn:
If you want to take a shot at solving this, have a look at e.g. this snippet of code
CEBRA/cebra/integrations/sklearn/cebra.py
Lines 46 to 50 in 5f46c32
def check_version(estimator): | |
# NOTE(stes): required as a check for the old way of specifying tags | |
# https://github.com/scikit-learn/scikit-learn/pull/29677#issuecomment-2334229165 | |
from packaging import version | |
return version.parse(sklearn.__version__) < version.parse("1.6.dev") |
You could then implement a conditional part where the version is checked, and the arg is passed based on the version of sklearn.
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.
I made a suggestion which is a bit more crisp and avoids code duplication
could you also update the PR description with the reference to the docs, pointing that this API change happend from 1.7.x to 1.8.x? |
Co-authored-by: Steffen Schneider <[email protected]>
Co-authored-by: Steffen Schneider <[email protected]>
Co-authored-by: Steffen Schneider <[email protected]>
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.
lgtm (wait with merge until #212 is merged, though)
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.
one final change, the threshold to fix the arg is 1.6, not 1.8
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.
all right, final from my end
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.
Lgtm; did not functionally test
The current CEBRA branch raised the following deprecation message
See the deprecation warning in the docs
This PR adds a wrapper to cebra/integrations/sklearn/utils.py which manually adapts the argument to
force_all_finite
if an outdated sklearn version is used.(edited by @stes )