Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-Class SVM. Binary Decision Tree. Issues with LIBSVM

So I'm trying to implement a multi-class SVM.

Matlab didn't like having more than two classes to classify data into, so I'm using a Binary Decision Tree to classify data.

I have three classes and am splitting the data into two and one, I'll then classify the first results using a SVM and then classify the results of this to the one unclassified class.

However, when using LIBSVM, I'm getting an error when using svmpredict:

td= a{1,1}; 
tc = b{1,1}; 

td1 = a{1,2}; %data to test svm
testdatatest = td1(1:30,1:4); %data to test svm

data = td(1:80, 1:4); %split data
target = tc(1:80);  %split data

model = svmtrain(data, target); %train

[predicted_label, accuracy, decision_values]=svmpredict(testdatatest,target, model); 

The error I get is:

Undefined function 'svmpredict' for input arguments of type 'struct'.

Any suggestions would be great, thanks.

like image 807
user3089 Avatar asked Aug 03 '26 12:08

user3089


1 Answers

you must download and make libsvm, open the zip file and select your langauges like Matlab etc. then make it! it would give you two files, now you are using Matlab SVM not libsvm.

good luck

like image 178
mohammad karim hardani asl Avatar answered Aug 06 '26 03:08

mohammad karim hardani asl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!