<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Hi Alex and Mainak,</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
The n_components argument is given None which yields 57 components and there are 64 channels with 7 bad channels which are not included so no I don't think it's because of the dimensionality reduction. Maybe it's some whitening.
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
To see something similar to what I'm looking at as far as scaling you can use the script below but I haven't been able to replicate the changes after ICA with sample data. I filedropped you both test epochs to the emails you responded to the thread with that
does show that.</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<span>from time import time<br>
</span>
<div>import matplotlib.pyplot as plt<br>
</div>
<div>import mne<br>
</div>
<div>from mne.preprocessing import ICA<br>
</div>
<div>from mne.datasets import sample<br>
</div>
<div><br>
</div>
<div>'''data_path = sample.data_path()<br>
</div>
<div>raw_fname = data_path + '/MEG/sample/sample_audvis-raw.fif'<br>
</div>
<div><br>
</div>
<div>raw = mne.io.Raw(raw_fname, preload=True)<br>
</div>
<div>events = mne.find_events(raw)<br>
</div>
<div>epochs = mne.Epochs(raw, events, preload=True)<br>
</div>
<div><br>
</div>
<div>'''<br>
</div>
<div>epochs = mne.read_epochs('test-epo.fif', preload=True)<br>
</div>
<div><br>
</div>
<div>epochs = epochs.pick_types(meg=False, eeg=True)<br>
</div>
<div><br>
</div>
<div>fig, (ax0, ax1) = plt.subplots(1,2)<br>
</div>
<div>epochs.average().plot(axes=ax0, show=False)<br>
</div>
<div><br>
</div>
<div>ica = ICA(method='fastica', random_state=0)<br>
</div>
<div>t0 = time()<br>
</div>
<div>ica.fit(epochs)<br>
</div>
<div>fit_time = time() - t0<br>
</div>
<div>epochs = ica.apply(epochs, exclude=ica.exclude)<br>
</div>
<div>epochs.average().plot(axes=ax1, show=False)<br>
</div>
<span>ica.plot_sources(epochs)</span><br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText">Translational NeuroEngineering Laboratory<br>
Division of Neurotherapeutics, Department of Psychiatry<br>
Massachusetts General Hospital, Martinos Center<br>
149 13th St Charlestown #2301, Boston, MA 02129</div>
</span></font></div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu <mne_analysis-bounces@nmr.mgh.harvard.edu> on behalf of Alexandre Gramfort <alexandre.gramfort@inria.fr><br>
<b>Sent:</b> Wednesday, July 3, 2019 2:30 AM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] Applying ICA with No Components Selected out but Signal Changes Using Default Parameters</font>
<div> </div>
</div>
<div>
<p><span style="padding:3px 10px; border-radius:5px; color:#ffffff; font-weight:bold; display:inline-block; background-color:#ff0000"> External Email - Use Caution </span></p>
<p></p>
<div dir="ltr">hi,
<div><br>
</div>
<div>can you check that the number of components you fit is equal to the number of channels?</div>
<div>If it's less you have a dimensionality reduction step.</div>
<div><br>
</div>
<div>Alex</div>
<div><br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jul 2, 2019 at 11:28 PM Mainak Jas <<a href="mailto:mainakjas@gmail.com">mainakjas@gmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<p><span style="padding:3px 10px; border-radius:5px; color:rgb(255,255,255); font-weight:bold; display:inline-block; background-color:rgb(255,0,0)"> External Email - Use Caution </span></p>
<p></p>
<div dir="ltr">
<div>Hi Alex,</div>
<div><br>
</div>
<div>Could you provide us a full script on the MNE sample data that we can run?</div>
<div><br>
</div>
<div>Mainak<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jul 2, 2019 at 5:14 PM Rockhill, Alexander P. <<a href="mailto:AROCKHILL@mgh.harvard.edu" target="_blank">AROCKHILL@mgh.harvard.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
Also, of note the ica scale is off by quite a lot in the plot_sources plot, it is way too zoomed in.</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
Alex<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_gmail-m_5391076763544010379gmail-m_1647867387637243957Signature">
<div style="font-family:Tahoma; font-size:13px">
<div class="x_gmail-m_5391076763544010379gmail-m_1647867387637243957BodyFragment">
<font size="2"><span style="font-size:10pt">
<div class="x_gmail-m_5391076763544010379gmail-m_1647867387637243957PlainText">Translational NeuroEngineering Laboratory<br>
Division of Neurotherapeutics, Department of Psychiatry<br>
Massachusetts General Hospital, Martinos Center<br>
149 13th St Charlestown #2301, Boston, MA 02129</div>
</span></font></div>
</div>
</div>
<div id="x_gmail-m_5391076763544010379gmail-m_1647867387637243957appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_5391076763544010379gmail-m_1647867387637243957divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b>
<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> <<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>> on behalf of Rockhill,
Alexander P. <<a href="mailto:AROCKHILL@mgh.harvard.edu" target="_blank">AROCKHILL@mgh.harvard.edu</a>><br>
<b>Sent:</b> Tuesday, July 2, 2019 3:25 PM<br>
<b>To:</b> <a href="mailto:mne_analysis@nmr.mgh.harvard.edu" target="_blank">mne_analysis@nmr.mgh.harvard.edu</a><br>
<b>Subject:</b> [Mne_analysis] Applying ICA with No Components Selected out but Signal Changes Using Default Parameters</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
In an analysis, I am running:<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
<div>ica = ICA(method='fastica', n_components=n_components, # n_components=None<br>
</div>
<div> random_state=seed)<br>
</div>
<span>ica.fit(inst2)</span></div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
...</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
inst2 = ica.apply(inst2, exclude=ica.exclude)<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
and when I skip all intermediate steps and just fit the ICA and apply it with an empty list for ica.exclude the signal still changes, quite a bit. I thought if no components were selected out and all the max PCA components were used the signal would be
unchanged or basically unchanged. Is this a bug or something with my implementation?</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
Thanks,</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
Alex<br>
</div>
<div style="font-family:Tahoma,Geneva,sans-serif; font-size:10pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_gmail-m_5391076763544010379gmail-m_1647867387637243957x_Signature">
<div style="font-family:Tahoma; font-size:13px">
<div class="x_gmail-m_5391076763544010379gmail-m_1647867387637243957x_BodyFragment">
<font size="2"><span style="font-size:10pt">
<div class="x_gmail-m_5391076763544010379gmail-m_1647867387637243957x_PlainText">
Translational NeuroEngineering Laboratory<br>
Division of Neurotherapeutics, Department of Psychiatry<br>
Massachusetts General Hospital, Martinos Center<br>
149 13th St Charlestown #2301, Boston, MA 02129</div>
</span></font></div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote>
</div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote>
</div>
</div>
</body>
</html>