1

How to implement one vs one multi class classification using libsvm? please help me with this problem.

I also read one vs all approach from this answers...Full example of multiple-class SVM with cross-validation using Matlab [closed]

My testing data : Features and last column is label

D = [

1           1          1           1             1
1           1          1           9             1
1           1          1           1             1
11          11         11          11            2
11          11         11          11            2
11          11         11          11            2
30          30         30          30            3
30          30         30          30            3
30          30         30          30            3
60          60         60          60            4
60          60         60          60            4
60          60         60          60            4
];

My Testing data is

inputTest = [
    1           1           1           1             
    11          11          11          10            
    29          29          29          30            
    60          60          60          60            
];
Community
  • 1
  • 1
shivang patel
  • 297
  • 1
  • 5
  • 15

1 Answers1

6

LIBSVM provides a Matlab interface. In the package, there is a very good README of how to use this interface via Matlab.

Usage would be:

matlab> model = svmtrain(training_label_vector, training_instance_matrix [, 'libsvm_options']);

with the following parameters:

    -training_label_vector:
        An m by 1 vector of training labels (type must be double).
    -training_instance_matrix:
        An m by n matrix of m training instances with n features.
        It can be dense or sparse (type must be double).
    -libsvm_options:
        A string of training options in the same format as that of LIBSVM.

However a training data consisting out of 12 examples is not enough to build a good SVM classifier. You should get more examples for the training and testing process.

rzo1
  • 5,561
  • 3
  • 25
  • 64