0

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!

user3761566
  • 87
  • 1
  • 8

1 Answers1

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

Community
  • 1
  • 1
lakshmen
  • 28,346
  • 66
  • 178
  • 276
  • 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
  • it cannot find svmtrain.exp – user3761566 Aug 09 '14 at 15:45
  • 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