Moritz Wurm
unread,Jun 12, 2019, 9:20:14 AM6/12/19Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cosm...@googlegroups.com
Dear Cosmo community,
Has anyone experience with extracting confusion matrices from time
generalization data?
I am running a time generalization MVPA with 80 x 80 time bins. To get
the confusion matrices I use measure_args.output = 'winner_predictions'.
However, I cannot unflatten it (as I would do it with
measure_args.output = 'accuracy' ):
K>> cosmo_unflatten(ds_res)
Error using cosmo_isfield>single_isfield (line 115)
Struct does not have field .a.fdim
Error in cosmo_isfield (line 71)
tf(k)=single_isfield(s,name{k},raise);
Error in cosmo_unflatten (line 134)
cosmo_isfield(ds,{'a.fdim','samples','fa'},true);
If I choose dimension 1, I also get an error:
K>> cosmo_unflatten(ds_res,1)
Error using cosmo_unflatten>unflatten_features (line 200)
Duplicate features at #1 and #2
Error in cosmo_unflatten (line 150)
[arr, dim_labels,dim_values]=unflatten_features(samples, ...
If I simply apply cosmo_confusion_matrix(ds), I get a single matrix
only. My workaround is a loop:
for i=1:length(ds_res.a.sdim.values{1})
for j=1:length(ds_res.a.sdim.values{2})
cond_idx = find(ds_res.sa.train_time==i &
ds_res.sa.test_time==j);
ds=cosmo_slice(ds_res,cond_idx);
MAT(i,j,:,:)=cosmo_confusion_matrix(ds);
end
end
Unfortunately, this is extremely slow. So I am wondering: is there a
better/faster way to do it?
I'd be very thankful for your suggestions!
Best wishes,
Moritz