<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Benjy,
<div class=""><br class="">
</div>
<div class="">Adding to Ingmar’s excellent suggestions: Have you thought a little bit about the possible (algorithmic) effect of inputting rank deficient data (i.e. the backprojected data) into the classification machinery?</div>
<div class=""><br class="">
</div>
<div class="">It would have been useful if you had given a little bit more detail. ‘drastically different results’ for ‘decoding trials’ can mean any combination of 1e6 types of drastically different results times 1e4 different ways for decoding, each of which
can probably be implemented in 1e2 different ways. So, we are facing about 1e12 different possibilities here. </div>
<div class=""><br class="">
</div>
<div class="">Given the lack of detail in your original post, I can only guess about what’s going on, so just to get you on your way: I would start to investigate the discrepancy by trying to understand the classification algorithm used, and whether the actual
used implementation uses proper regularization etc. Also, if you have been using cross-validation, what you refer to as ‘drastically different results’ could also come about by the random creation of the train/test folds. Thus, I would only compare results
using a fully deterministic procedure.</div>
<div class=""><br class="">
</div>
<div class="">Good luck,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 8 Sep 2023, at 16:04, Barnett, Benjy via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hey everyone,
<div class=""><br class="">
</div>
<div class="">I’m trying to work out why I am getting different decoding results using what I think to be rather equivalent pipelines.</div>
<div class=""><br class="">
</div>
<div class="">I am currently try to decode trials from my dataset after removing the first principal component. However, I’m getting drastically different results depending on how I do the component removal.</div>
<div class=""><br class="">
</div>
<div class="">If I follow what I imagine is the recommended method, I do this:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier; min-height: 13px;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.method = <span style="color: #aa04f9" class="">'pca'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.updatesens = <span style="color: rgb(170, 4, 249);" class="">'yes'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
comp = ft_componentanalysis(cfg, data);</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
%remove component</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.component = 1;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
data = ft_rejectcomponent(cfg,comp,data); %data to be decoded</div>
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
<br class="">
</div>
<div class="">However, I could instead just decode the components after removing the first, like this:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.method = <span style="color: rgb(170, 4, 249);" class="">'pca'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.updatesens = <span style="color: rgb(170, 4, 249);" class="">'yes'</span>;</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
comp = ft_componentanalysis(cfg, data);</div>
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
<br class="">
</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
<div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""> %remove component</div>
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg = [];</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
cfg.channel = comp.label(2:end);</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
data = ft_selectdata(cfg,comp); %data to be decoded</div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Courier;" class="">
<br class="">
</div>
</div>
<div class=""><br class="">
</div>
<div class="">The first method (back projection) gives me results almost identical to that of the decoding of the full, original data - whereas the second method (decoding raw components) abolishes all successful decoding. </div>
<div class=""><br class="">
</div>
<div class="">I’m not sure what the technical difference is here, because in my mind the information contained in both datasets (components vs. back projected) is the same, so I’m not sure why one abolishes decoding but the other does not. As such, I’m not
sure which method is the correct one for my purposes of simply removing the first principal component prior to decoding.</div>
<div class=""><br class="">
</div>
<div class="">I appreciate any guidance or help,</div>
<div class="">Benjy</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!6sJPm7BuqocNxzn9oOgcSTOsLqQ8880S5BZizdhophwPi_5Jo7G86SEnON4Z1nKB8tvuqZHw-P9TC0BYRYnLXNqjULJ8qDSkIjvL5g$">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>