# Erros: ica.decompose\_epochs

**URL:** <https://mne.discourse.group/t/erros-ica-decompose-epochs/1052>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [July 25, 2016, 4:40pm UTC](https://mne.discourse.group/t/erros-ica-decompose-epochs/1052 "2016-07-25T16:40:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 25, 2016, 4:40pm UTC](https://mne.discourse.group/t/erros-ica-decompose-epochs/1052/1 "2016-07-25T16:40:49Z")

</div>

Hi,

I am trying to to apply ICA on my data, but when I want to decompose  
sources for epochs, I get this error:

~/Desktop/ICA/prova.py:56: AttributeError: 'ICA' object has no attribute  
'decompose\_epochs'

I have installed Scikit-Learn, but I still get this error. How can I solve  
it?

Thanks  
Emanuela  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20160725/77857571/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160725/77857571/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 25, 2016, 5:07pm UTC](https://mne.discourse.group/t/erros-ica-decompose-epochs/1052/2 "2016-07-25T17:07:18Z")

</div>

You seem to be referring to an old API of ICA, take a look at how it works  
now:  
[http://martinos.org/mne/dev/auto\_tutorials/plot\_artifacts\_correction\_ica.html](http://martinos.org/mne/dev/auto_tutorials/plot_artifacts_correction_ica.html)

In short, after instantiating the ICA you use the .fit() method to fit it  
to the data.  
Then you can for example use .get\_sources() or mark components as bad and  
then .apply() to the data.  
?

2016-07-25 18:40 GMT+02:00 Emanuela Liaci \<emanuela.liaci at [gmail.com](http://gmail.com)\>:

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 26, 2016, 7:34pm UTC](https://mne.discourse.group/t/erros-ica-decompose-epochs/1052/3 "2016-07-26T19:34:57Z")

</div>

Hi,

I want to remove my selected components (.apply) from ICA analysis from the  
epochs (created by Epochsarray) but I get this error: 'EpochsArray' object  
has no attribute 'apply'. How can I solve this issue?

Many thanks  
Emanuela

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [July 26, 2016, 8:01pm UTC](https://mne.discourse.group/t/erros-ica-decompose-epochs/1052/4 "2016-07-26T20:01:29Z")

</div>

you need to call the apply method on the ica object. So something like

ica.fit(epochs)  
ica.exclude = [7, 12]  
ica.apply(epochs)

(not epochs.apply...)

HTH  
Alex
