# CSP components selection

**URL:** <https://mne.discourse.group/t/csp-components-selection/2027>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [December 19, 2019, 6:51am UTC](https://mne.discourse.group/t/csp-components-selection/2027 "2019-12-19T06:51:53Z")\
**Posts on this page:** 3\
**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:** [December 19, 2019, 6:51am UTC](https://mne.discourse.group/t/csp-components-selection/2027/1 "2019-12-19T06:51:53Z")

</div>

External Email - Use Caution

Dear MNE team,

We are trying to solve the left vs right motor imagery classification  
problem using MNE python for the first time. I have some experience of  
using CSP. Normally, if we give N=2, then we select the first two and last  
two spatial filters from the CSP matrix to create our feature vector. When  
we did the same thing in MNE python, it is only selecting the two  
components. Can you advise how to handle this?

Best regards,  
Pramod  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20191219/de0ca10b/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191219/de0ca10b/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:** [December 19, 2019, 9:16am UTC](https://mne.discourse.group/t/csp-components-selection/2027/2 "2019-12-19T09:16:34Z")

</div>

External Email - Use Caution

hi,

setting N=4 should give you the first 2 and the last 2. Feature space  
will then be 4 dimensional.

see how we do it here:

[https://github.com/mne-tools/mne-python/blob/maint/0.19/mne/decoding/csp.py#L204](https://github.com/mne-tools/mne-python/blob/maint/0.19/mne/decoding/csp.py#L204)

HTH  
Alex

---

<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:** [December 21, 2019, 9:14am UTC](https://mne.discourse.group/t/csp-components-selection/2027/3 "2019-12-21T09:14:18Z")

</div>

External Email - Use Caution

Thanks for your reply.

Best regards,  
Pramod
