-
Notifications
You must be signed in to change notification settings - Fork 576
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
[MAINT] Resolve sklearn 1.4.dev0 related failure of decoder test #4132
Comments
OK. Do you know whether the sklearn team is working on it ? |
Not sure it's a bug from them necessarily. They are now using a private attribute called |
@glemaitre wondering if you have any input on the change on the scikit-learn side? |
We change the internal scoring with a refactoring. Concretely, we check the This said, I need to understand if the failure would be a real regression or more a design issue. One thing that might potentially make sense in scikit-learn would be to be slightly more leninent and change the I am under the impression that this will not helped in your case however. Could you tell me what is the reason for calling |
Looking at the decoder class, I would overwrite Perfectly, I assume that I don't know enough the code right now to know what is the reason to inherate from |
I looked a bit closer, I am not sure that this is necessary to inherit indeed. So I am wondering if it would be better to remove the inheritance from class Decoder(ClassifierMixin, _BaseDecoder):
...
class DecoderRegressor(MultiOutputMixin, RegressorMixin, _BaseDecoder):
... On thing weird is to define a public However, going in this direction will break some backward compatibility but it will be compatible with the scikit-learn rules. |
@glemaitre thanks for the feedback! I'm not sure about the original design intention of some of these choices so I'll have to do some tests to see if we can change the inheritance and I'll check on the defined |
You can ping on your PR. I don't mind reviewing if you want. |
The setup that we have is most likely related to having to extract data from nifti images into a compatible 2D array of n_samples x n_features using a mask or masker object. I think BTW this works in the stable versions of nilearn and scikit-learn because if is_regressor(clf):
y_pred = method_caller(clf, "predict", X) along with the inheritance of the This hack doesn't work in the dev version of scikit-learn where all the scorer classes inheriting from I'll look into how to best refactor our code to properly handle the inheritances, transformation of our data, and be compatible with the upcoming changes in scikit-learn |
The failure still seen here in the numpy2 job: test_decoder_binary_classification_with_masker_object
is actually related to an inconsistency between nilearn and scikit-learn dev version from their nightly releases which we have to use to test against numpy v2.0. All the numpy deprecations so far are dealt with in this PR so I'd rather merge this and deal with the sklearn deprecation separately
Originally posted by @ymzayek in #4130 (comment)
The text was updated successfully, but these errors were encountered: