shivang patel
shivang patel

Reputation: 317

How to realize a 1 vs 1 multiclass classification using libsvm library (Matlab)?

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            
];

Upvotes: 1

Views: 498

Answers (1)

rzo1
rzo1

Reputation: 5751

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.

Upvotes: 6

Related Questions