<div dir="ltr">Hi Ana,<div><br></div><div>Indeed, in theory it&#39;s probably best to report the patterns that match the decoding scores, and thus use cross-validation:<div><br><div>e.g.</div><div><br></div><div>X=epochs.get_data()</div><div>y=epochs.events[:, 2]<br></div><div><br></div><div><br></div><div>pipeline = make_pipeline(StandardScaler(), LogisticRegression())</div><div>patterns = list()</div><div>for train, test in cv.split(X, y):</div><div>     lm = LinearModel(pipeline)</div><div>     lm.fit(X, y)</div><div>     pattern = get_coef(lm, &#39;patterns_&#39;)</div><div>     patterns.append(pattern)</div><div>patterns= np.mean(patterns, axis=0)</div><div><br></div><div>However, in practice this CV is an overkill because the patterns (and spatial filters) correspond to the model, and thus depend on the training data. Since the training splits are not independent with one another, the patterns across splits should be very similar - and in fact converge towards the patterns of the non-cv fit.</div><div><br></div><div>Hope that helps</div><div><br></div><div>Jean-Remi</div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 January 2018 at 11:15, Ana Vedoveli <span dir="ltr">&lt;<a href="mailto:ana.vedoveli@gmail.com" target="_blank">ana.vedoveli@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div><br></div><div>I am dealing with a classification problem (Linear SVMs) in EEG data. I am a new-comer in Python and also in the MNE community, so what I am going to ask might sound silly. </div><div><br></div><div>I am trying to estimate the patterns using the LinearModel and get_coef(). I was looking in the documentation (<a href="http://martinos.org/mne/stable/auto_examples/decoding/plot_linear_model_patterns.html" target="_blank">http://martinos.org/mne/<wbr>stable/auto_examples/decoding/<wbr>plot_linear_model_patterns.<wbr>html</a>), and saw that the LinearModel() class is not cross-validated. I was wondering it would make sense to retrieve cross-validated spatial patterns?</div><div><br></div><div>Thank you for your attention.</div><div><br></div><div>Best wishes,</div><div>Ana Vedoveli</div></div>
<br>______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>