-
Notifications
You must be signed in to change notification settings - Fork 594
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
use scikit-learn check_estimator to ensure compatibiity of Nilearn estimators with scikit-learn #4538
Comments
If it's not a hassle, I rather keep the compat with sklearn. |
Yup me too. |
one example that loops through all the checks from sklearn.utils.estimator_checks import check_estimator
from nilearn.decoding.decoder import (
Decoder,
)
def test_check_estimator():
"""Check compliance with sklearn estimators."""
model = Decoder()
for estimator, check in check_estimator(estimator=model, generate_only=True):
try:
check(estimator)
except Exception:
print(f"FAIL: {check}")
else:
print(f"SUCCESS: {check}")
From a quick inspection it looks like most of the checks that fail actually do so because the |
See for example. I don't think we want to start supporting numpy arrays, right? At a minimum we can run some checks to make sure that those that pass, keep on passing, so to avoid 'regressions'. And then we may have some checks that currently fail, but we may want to still run so we may have to write our own adapted checks. |
Indeed, we don't want to enforce Numpy arrays. |
yeah I am afraid so. this may take some time but given there are several checks we can probably add them one by one through several PRs |
follow up on this:
|
Maybe worth double checking if those tests are related to this issue: https://github.com/nilearn/nilearn/blob/main/nilearn/decoding/tests/test_sklearn_compatibility.py Or if those tests are still needed. |
raised by #4533
see https://scikit-learn.org/dev/developers/develop.html#rolling-your-own-estimator
quickly checked on a couple of Nilearn estimators and they seem to fail: will add code examples when in front of a real computer
may be worth discussing to see if we want to have 100% compliance or if we should have our own version of check_estimator
The text was updated successfully, but these errors were encountered: