Tedana computing PCA with aic

Hi everyone, I’m a postdoc in cognitive neuroscience and very new to multi-echo MRI. I’m using tedana to preprocess my multi-echo MRI data after realignment. But the default pca method ica does not work.

The error message is:
AttributeError: ‘PCA’ object has no attribute ‘n_features_’

When I tried with kundu everything just works fine, but the ICA had issues to converge, so I wanted to use the default ica instead.

Thank you!

It looks like you are running this within a notebook, which I am less familiar with. It should work, of course, but perhaps something has gone wrong. Is it possible to try from the command line, using the tedana command (after a pip install command)? Assuming you have nii data, or can produce it, that could be an alternative approach.

@tsalo may be able to offer more insight here. Are you using the latest release of tedana and it’s dependencies?

1 Like

It looks like the problem is due to scikit-learn having removed the n_features_ attribute in 1.4. The MAPCA devs are aware of this (see `n_features_` from sklearn's PCA is deprecated · Issue #58 · ME-ICA/mapca · GitHub), but haven’t merged a fix yet. @qingfang please try installing an older version of scikit-learn (1.3 maybe).

2 Likes

Thank you! That has nicely solved my problem.

We will be releasing a new version of maPCA that solves this issue today, so you will be able to use newer versions of scikit learn with tedana.

1 Like