variable called "acts" in test_svm.m

30 views
Skip to first unread message

enoch...@gmail.com

unread,
Nov 2, 2017, 8:33:14 AM11/2/17
to Princeton MVPA Toolbox for Matlab
Hello, I'm trying to use svm as my classifier, and I tried using train_svm.m and test_svm.m instead of the train_bp.m and test_bp.m from the introductory tutorial.

However, I get an error because in running perfmet_maxclass, the acts argument is empty.
In fact, acts is just '' at that point.

After examining test_svm.m, I found out why. Following is taken from test_svm.m:

acts = zeros(size(testtargs));

sanity_check(testpats,testtargs,scratch);
test_max_idx(test_max_idx == 1) = 1;
test_max_idx(test_max_idx == 2) = -1;

% Now test generalization performance on the test data
[scratch.err, scratch.predictions] = svmclassify(testpats',test_max_idx',scratch.model);

acts = '';

Instead of setting acts as an nOuts x nTestTimepoints matrix that contains the activations of the output units at test as it is supposed to do,
test_svm.m simply does acts = '';

What needs to be done if I want to use test_svm.m right?

Thank you. 

Greg Detre

unread,
Nov 9, 2017, 7:47:02 PM11/9/17
to mvpa-t...@googlegroups.com
I don't have access to a running copy of Matlab to inspect, but you could try looking at the contents of scratch.predictions. That sounds like it could be what you're looking for. Good luck!


--
You received this message because you are subscribed to the Google Groups "Princeton MVPA Toolbox for Matlab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvpa-toolbox+unsubscribe@googlegroups.com.
To post to this group, send email to mvpa-t...@googlegroups.com.
Visit this group at https://groups.google.com/group/mvpa-toolbox.
For more options, visit https://groups.google.com/d/optout.



--
-- 
Greg Detre
skype:gdetre

Jeff Johnson

unread,
Nov 10, 2017, 11:04:29 AM11/10/17
to mvpa-t...@googlegroups.com
My MATLAB finds the test_svm function in \contrib\learn\ first, which has this in place of that "acts = ";" line:

acts = scratch.predictions';
acts=[acts;acts];

The version of test_svm in \core\learn\ is like yours, so maybe you can change it if MATLAB is using that one.


Reply all
Reply to author
Forward
0 new messages