TDT:inter-subject pattern analysis

hi ~
I am trying to do an inter-subject pattern analysis just like this picture

     However, after cross-validation, i have only one accuracy map for all the subjects other than one for each subject.  how can TDT output accuracy map for every subject?
     here is my design for 3 subjects for example. 



There is the possibility to save the results for each cross-validation fold separately. This is currently the yellow strip in your design matrix. Right before creating the design using make_design_cv (or whatever design you are running), you can manually set the variable cfg.files.set = 1:n_sub;
where n_sub is the number of subjects. (the default for cfg.files.set is all 1s)

This will save the results separately for each iteration, i.e. in your case for each subject.


Hi there,

Trying to get separate accuracy values for each iteration, I applied the suggested code right before the make_design_cv command, but I keep on getting this error:

Matrix dimensions must agree.

Error in make_design_cv (line 213)
train_filter = (cfg.files.chunk ~= chunk_numbers(i_step)) & set_filter;

Error in decoding_template_between_subject_ania (line 239) = make_design_cv(cfg);

The cfg.files.set turned into 1x69 double (I have 69 subjects), but for some reason the design could not be created.

I will appreciate any clues about what may be wrong.

Cheers! Ania

Hi Ania,

Thanks for posting this. It looks as if cfg.files.set and cfg.files.chunk have different dimensions. Make sure that you set both to have the same length.


Thanks Martin!
Each of my 69 subjects underwent 2 conditions. I thought I should have 69 chunks (1,1,2,2…69,69) and my labels should be 1,-1,1,-1 etc. This way both the cfg.files.chunk and the cfg.files.label are 138x1 doubles. How should the cfg.files.set look like in this case?

Hi Ania,

I’m not entirely sure but please try using the same as the chunks (i.e. 1,1,2,2, etc.).

Alternatively, just leave out the set variable and manually set it once the design has been created as = 1:69; or = (1:69)'; (I’m not entirely sure out of the top of my head if it has to be a column vector or can also be a row vector)


Unfortunately setting it in the same way as the chunks did not work, but after setting = 1:69; manually I got the accuracy for every single subject. Thanks Martin for such a quick help!

1 Like