Hi Everyone, Could you please let me know if the latest opencv support multiclass svm. Thanks in advance

asked 2014-06-23 04:05:06 -0500

updated 2014-06-23 04:08:50 -0500

berak gravatar image

Multi class SVM

edit retag flag offensive close merge delete


yes it does. just use a POLY or LINEAR flag, not RBF

berak gravatar imageberak ( 2014-06-23 04:08:13 -0500 )edit

Is it possible to have a single SVM classifier perform multi-class classification? Eg: If I have 5 classes say A,B,C,D,E with label 0,1,2,3,4 and if a single SVM classifier is trained for this data, then it will correctly label class B element with label 2. From what I read, it said that I will have to train multiple SVM binary classifiers and then predict label using One-to-All or One-to-One comparision. Could some one clear things for me?

amit shah gravatar imageamit shah ( 2015-05-20 07:42:23 -0500 )edit

@Amit , both ways are possible. either have 1 svm with 5 classes, or 5 one-against all svm's .

you will have to do your own experiments, what works better on your data.

berak gravatar imageberak ( 2015-05-20 07:47:24 -0500 )edit

5 one-against all SVM? I dint quite get you!

amit shah gravatar imageamit shah ( 2015-05-20 07:49:31 -0500 )edit

the only difference is in the labels, for one-vs-all you'd have 0,1,0,0,0 labels for B, 0,0,1,0,0 for C, etc.

berak gravatar imageberak ( 2015-05-20 07:54:51 -0500 )edit

So basically in 5 one-against all, I will have 5 different SVM classifiers. The first classifier will check if the test-class belongs to class A. If it belongs to it, I will predict '1' else '0'. Same will happen for other SVM classifiers and at the end, the classifier having predicted value '1' will be selected. Am I correct ?

amit shah gravatar imageamit shah ( 2015-05-20 08:06:55 -0500 )edit

yes, exactly.

berak gravatar imageberak ( 2015-05-20 08:08:31 -0500 )edit