-
Notifications
You must be signed in to change notification settings - Fork 7
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
Running ridge_cv
with a pre-defined parcellation yields ValueError
#36
Comments
PairwiseAlignment also accepts instances of estimators in method so here,
you could
*from fmralign.alignment_methods import RidgeAlignment*
*custom_ridge = RidgeAlignment(cv=1)*
*alignment = PairwiseAlignment(method=custom_ridge, ...)*
But still it seems weird to me that clustering on a parcellation changes
anything for Ridge cross-validation, since Ridge should be applied on as
many samples as you have.
Can you provide replication code ? I'd like to have a look.
Le lun. 2 déc. 2019 à 16:38, Elizabeth DuPre <notifications@github.com> a
écrit :
… Running ridge_cv with a predefined parcellation such as the BASC
parcellation
<https://nilearn.github.io/modules/generated/nilearn.datasets.fetch_atlas_basc_multiscale_2015.html>
yields an error:
ValueError: Cannot have number of splits n_splits=4 greater than the
number of samples: n_samples=1.
This seems to be because the cv value for the RidgeAlignment estimator is
hard-coded at 4
<https://github.com/Parietal-INRIA/fmralign/blob/5f3380d94f52652ebb8e643d4bd2b6bad4bc4d32/fmralign/alignment_methods.py#L255>.
Changing to another value such as None for LOO allows ridge_cv to run to
completion.
Would it make sense to expose cv as an attribute in the user-facing
PairwiseAlignment class ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#36?email_source=notifications&email_token=ABR7RNDAYRLNJOJDK2AIKADQWUTXLA5CNFSM4JTXXAS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5JTLYA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABR7RNH6ZNE33CA5KUVXNMDQWUTXLANCNFSM4JTXXASQ>
.
|
Here's the code I was trying. But that's a great idea ! What do you think if I create another example in the documentation that includes that ? |
Hello I answered this one in #37 after running your code. The problem here is that you try to fit ridge_cv on only one sample and it's built-in cross validation scheme requires at least one image per fold. Anyway, it's always a bad idea to learn an alignment on only one sample because it'll be very noisy. +1 for underlining the ability to use a non-default estimator in the docs though, if you have an idea on where it should take place it'd be great. |
Running
ridge_cv
with a predefined parcellation such as the BASC parcellation yields an error:ValueError: Cannot have number of splits n_splits=4 greater than the number of samples: n_samples=1.
This seems to be because the
cv
value for theRidgeAlignment
estimator is hard-coded at 4. Changing to another value such asNone
for LOO allowsridge_cv
to run to completion.Would it make sense to expose
cv
as an attribute in the user-facingPairwiseAlignment
class ?The text was updated successfully, but these errors were encountered: