[FieldTrip] Decoding principal components vs. Backprojected sensor-level data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Sat Sep 9 15:09:41 CEST 2023

Hi Benjy,

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?

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.

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.

Good luck,


On 8 Sep 2023, at 16:04, Barnett, Benjy via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hey everyone,

I’m trying to work out why I am getting different decoding results using what I think to be rather equivalent pipelines.

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.

If I follow what I imagine is the recommended method, I do this:

    cfg = [];
    cfg.method = 'pca';
    cfg.updatesens = 'yes';
    comp = ft_componentanalysis(cfg, data);

   %remove component
    cfg  = [];
    cfg.component = 1;
    data = ft_rejectcomponent(cfg,comp,data); %data to be decoded

However, I could instead just decode the components after removing the first, like this:

    cfg = [];
    cfg.method = 'pca';
    cfg.updatesens = 'yes';
    comp = ft_componentanalysis(cfg, data);

   %remove component
    cfg = [];
    cfg.channel = comp.label(2:end);
    data = ft_selectdata(cfg,comp); %data to be decoded

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.

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.

I appreciate any guidance or help,
fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230909/7e5d79cb/attachment.htm>

More information about the fieldtrip mailing list