[Mne_analysis] EEG redundancy data reduction based on N-dimensional PCA

Marijn van Vliet w.m.vanvliet at gmail.com
Thu Mar 1 02:08:19 EST 2018
Search archives:

Dear Khorshed Alam,

try this:

epochs = mne.Epochs(eeg_channels, events=events, event_id=event_id, tmin=-0.2, tmax=0.5, proj=True, baseline=(None, 0), preload=True)
n_components = 19  # Number of components to keep (should be less then the number of channels)
X = epochs.get_data()
pca = UnsupervisedSpatialFilter(PCA(n_components, whiten=True), average=False)
pca_data = pca.fit_transform(X)

best,
Marijn.

the PCA expects a 2-dimensional data matrix: channels x 

> On 1 Mar 2018, at 16:52, MD KHORSHED ALAM <khorshed.alam at live.iium.edu.my> wrote:
> 
> Dear MNE Group,
> 
> I am currently working on MNE for Neuro-feedback application. I would like to use PCA for dimensional EEG data reduction.
> 
> I followed the workflow explain in the example:
> 
> epochs = mne.Epochs(eeg_channels, events=events, event_id=event_id, tmin=-0.2, tmax=0.5, proj=True, baseline=(None, 0), preload=True)
> 
> X=epochs.get_data()
> 
> pca = UnsupervisedSpatialFilter(PCA(19), average=False)
> 
> pca = PCA(n_components=None, whiten=False)
> 
> pca_data = pca.fit_transform(X)
> 
> pca_reduced=pca.transform(X)
> 
> Error:
> 
> ValueError: Found array with dim 3. Estimator expected <= 2.
> 
> Any help would be highly appreciated.
> 
> 
> 
> 
> Thanks With Warm Regards,
> MD. KHORSHED ALAM (Shishir)
> Graduate Research Assistant (GRA)
> Center of Intelligent Signal and Imaging Research (CISIR)
> Department of Electrical and Electronic Engineering
> Universiti Teknologi PETRONAS
> Bandar Seri Iskandar
> 32610 Tronoh
> Perak Darul Ridzuan
> Malaysia
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in error
> but does not contain patient information, please contact the sender and properly
> dispose of the e-mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1386 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180301/58d9c579/attachment.bin 


More information about the Mne_analysis mailing list