dongqunxi / mne-python

MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
http://martinos.org/mne/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Twice ICA components differences #3

Closed dongqunxi closed 10 years ago

dongqunxi commented 10 years ago

@dengemann When I used ICA twice continually, I got different amount of components. I think it must be something wrong about my script.

<ICA  |  raw data decomposition, fit: 13900 samples, 184 components>
<ICA  |  raw data decomposition, fit: 13900 samples, 167 components>

import mne
from mne.preprocessing import ICA
from mne.datasets import sample

data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
n_components=0.99
max_pca_components=None

raw = mne.fiff.Raw(raw_fname, preload=True)
picks = mne.fiff.pick_types(raw.info, meg=True, exclude='bads')
ica = ICA(n_components=n_components, max_pca_components=max_pca_components,
               random_state=0)
ica.decompose_raw(raw, picks=picks, decim=3)
print ica
raw_new = ica.pick_sources_raw(raw)
picks = mne.fiff.pick_types(raw_new.info, meg=True, exclude='bads')
ica = ICA(n_components=n_components, max_pca_components=max_pca_components,
          random_state=0)
ica.decompose_raw(raw_new, picks=picks, decim=3)
print ica

Best wishes, Qunxi Dong

dengemann commented 10 years ago

@dongqunxi the interesting part about the problem is that this problem occurs even after making sure that the n_pca_components is the same. The way you wrote the script I would not be surprised because by default you only keep 64 PCA components.

dongqunxi commented 10 years ago

Yes, I have set different values of n_pca_components, and the amount is still changed. Then will the default way affect the amount of components? How to keep the ICA results correct. Because the amount is always changing, I think the result is incorrect.

Best wishes, Qunxi Dong

2014-02-27 11:10 GMT+01:00 Denis A. Engemann notifications@github.com:

@dongqunxi https://github.com/dongqunxi the interesting part about the problem is that this problem occurs even after making sure that the n_pca_components is the same. The way you wrote the script I would not be surprised because by default you only keep 64 PCA components.

Reply to this email directly or view it on GitHubhttps://github.com/dongqunxi/mne-python/issues/3#issuecomment-36227486 .

dengemann commented 10 years ago

@dongqunxi btw. when opening an issue that's for everyone you should not use your fork but the mne-python origin. Otherwise no one will see you.

dengemann commented 10 years ago

@dongqunxi https://github.com/mne-tools/mne-python/pull/1151

dongqunxi commented 10 years ago

Sorry, next time I will. :)