Design for two different sets in the same decoding analysis

Dear TDT experts,

How can the design matrix be specified for two designs with two different sets within the same analysis?
I’m talking about what Figure 3F from the TDT paper shows (figure caption: “Example design for two leave-one-run-out designs with two different sets, in the same decoding analysis. The results are reported combined or separately for each set which can speed-up decoding.”). The figure describes a cross-validation design for two sets, is it possible to perform a cross-classification with two sets?

The idea is to have (in the same analysis):

  • design 1: training on labelname1classA labelname1classB, testing on labelname2classA labelname2classB,
  • design 2: training on labelname1classC labelname1classD, testing on labelname2classC labelname2classD.

When trying:

cfg = decoding_describe_data(cfg,...
        {labelname1classA labelname1classB labelname1classC labelname1classD ...
        labelname2classA labelname2classB labelname2classC labelname2classD},...
        [1 2 3 4 -1 -2 -3 -4],...
        regressor_names,...
        beta_loc,...
        [1 1 2 2 -1 -1 -2 -2]);

I got the error:

Wrong number of labels in cfg.files.xclass. Cross classification needs exactly one training and one test set.

Hence I was wondering if 2-set cross-classification is allowed by the toolbox, or maybe the design is specified differently?

In addition, where/how can we define the results to be reported combined or separately? And related to that, where can we find more information on how the results from a two-set analysis are combined?

I appreciate any lights you can provide. Thanks in advance!

Ricardo.

After digging further I think using combine_designs.m could do it:

cfg1 = decoding_describe_data(cfg,...
             {labelname1classA labelname1classB ...
             labelname2classA labelname2classB},...
             [1 -1 1 -1],...
             regressor_names,...
             beta_loc,...
             [1 1 2 2]);
cfg2 = decoding_describe_data(cfg,...
             {labelname1classC labelname1classD ...
             labelname2classC labelname2classD},...
             [1 -1 1 -1],...
             regressor_names,...
             beta_loc,...
             [1 1 2 2]);
cfg1.design = make_design_xclass(cfg1);
cfg2.design = make_design_xclass(cfg2);
cfg = combine_designs(cfg1,cfg2);

The design matrix makes sense for me except for the ‘0’ in the legend (between -1 and 1), which I’m not sure how to interpret:
image

Is this making sense for you?

Thanks in advance!

That’s exactly how to do it, well done.

I am not sure why 0 is shown legend. Probably the value of some or all of the labels that are unused and are thus shown grey were set to 0 through combine design. As no brown is shown in the design matrix, it’s not important, however.

Happy decoding :slight_smile: