libSVM for multiclass classification in Matlab
3 次查看(过去 30 天)
显示 更早的评论
Hello
I want to use libSVM with Matlab for a classification problem with 4 classes.
1. I think libSVM does not support one-vs-all natively. I found two approaches to do one-vs-all:
Using probability outputs, e.g. http://stackoverflow.com/questions/9041753/multi-class-classification-in-libsvm
Using decision values, e.g. http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/ovr_multiclass/ovrpredict.m
Which one is better to use and which one works with non-linear SVM (rbf kernel)?
2. There is another way for doing one-vs-all, namely using the weight vectors w. That means I train a SVM for all classes (one-vs-all), in the end I have 4 SVMs (4 classes) and 4 weight vectors: w1, w2, w3, w4. For the test data x I calculate now just w1'*x, w2'*x, w3'*x and w4'*x and pick the class with the highest value, e.g. if w1'*x gives the highest value I will pick class 1.
Would this also work for non-linear SVM?
0 个评论
回答(1 个)
med djo
2017-1-17
if you will be able to do this, it will give you the answer Sir .... Assuming that you have three different classes (1,2,3). The first class contains two samples, the second contain one, the third contain one. From each class, you will extract two values (Average and median) of the color (for example). It will give you that: classe 1: (15, 20) classe 1: (16, 21) classe 2: ( 18, 22) classe 3: (22, 24) . On matlab, we make a matrix (Matrix for learning), which contains two columns, four lines and which contain (15, 20; 16, 21;18, 22; 22, 24). And we made a matrix composed of a single column (label matrix), this matrix (1, 1, 2, 3). We execute learning SVM with SVMtrain from libSVM. The parameters I have given you as an example correspond to the RBF kernel. The gamma value, c (varies between 10 and 100,000). Can you execute this scenario in Matlab using LibSVM??
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!