I want to perform a decoding by applying an SVM classifier to a data matirx S, the size of which is 1089*43093,and the prediction accuracy of the labels, denoted as r, is calculated based on a 11-fold cross-validation classification procedure.The 11 fold cross-validation is based on the data matrix S, which is separated into the training and testing data sets for classification. Specifically, this cross-validation is only for calculating the prediction accuracy r. Can anyone give me some suggestion to do this? Thanks a lot!
Asked
Active
Viewed 1,275 times
0
-
use libsvm, helps to get started on svm.. – lakshmen Aug 09 '14 at 13:42
-
is there any tutorial for me to read something about how to use libsvm? – user3761566 Aug 09 '14 at 13:46
-
I want to use matlab implement it – user3761566 Aug 09 '14 at 13:46
-
anyone give me some suggestion? – user3761566 Aug 09 '14 at 14:06
-
http://www.csie.ntu.edu.tw/~cjlin/libsvm/#matlab – Aug 09 '14 at 14:08
-
i thought it was some Matlab code. – user3761566 Aug 09 '14 at 14:26
-
yes it is, you need to install the library and you can use SVM with it.. – lakshmen Aug 09 '14 at 14:31
-
I googled it for you, i'm kind like that. http://www.mathworks.co.uk/help/stats/classificationsvm.crossval.html – QED Aug 09 '14 at 16:42
-
when I use this:svmModel = svmtrain(meas(trainIdx,:),group(trainIdx),'Autoscale',true,... the error shows: "undefined variable meas" How to fix this problem? – user3761566 Aug 09 '14 at 18:52
1 Answers
0
To carry out SVM classification, use libsvm.
A good tutorial to start would be: https://sites.google.com/site/kittipat/libsvm_matlab
Matlab code for reference on cross validation:
Example of 10-fold SVM classification in MATLAB
Retraining after Cross Validation with libsvm
Installing LibSVM on MATLAB: http://www.youtube.com/watch?v=Wz_4h_bH7-c
-
Building with 'Microsoft Visual C++ 2013 Professional'. Could Not Find C:\D disk\MATLAB\R2014a\libsvm-3.18\matlab\svmtrain.exp Could Not Find C:\D disk\MATLAB\R2014a\libsvm-3.18\matlab\svmtrain.exp MEX completed successfully. – user3761566 Aug 09 '14 at 15:44
-
-
When I try to load s_matrix groups = ismember(s_matrix,'setosa'); it shows error like this:Error using horzcat Dimensions of matrices being concatenated are not consistent. – user3761566 Aug 09 '14 at 16:46
-
How to fix this? I follow the steps on this website:http://stackoverflow.com/questions/3070789/example-of-10-fold-svm-classification-in-matlab/3071938#3071938 – user3761566 Aug 09 '14 at 16:49
-
when I use this:svmModel = svmtrain(meas(trainIdx,:),group(trainIdx),'Autoscale',true,... the error shows: "undefined variable meas" How to fix this problem? – user3761566 Aug 09 '14 at 18:51
-
@ Parag S. Chandakkar,I still do not know how to code this question by following an example in this link: http://stackoverflow.com/questions/25222661/how-to-fix-the-fisheriris-cross-classification?noredirect=1#comment39289610_25222661 – user3761566 Aug 10 '14 at 00:07