libsvm - Strict class labels in SVM -


i'm using one-vs-all 21-class svm categorization.

i want label -1 mean "not in class" , label 1 mean "indeed in class" each of 21 kernels.

i've generated pre-computed kernels , test vectors using standard.

using easy.py went 20 of classes, 1 of them labels switched inputs should have been labelled 1 being in class instead labelled -1 , vice-versa.

the difference in class first vector in pre-computed kernel labelled 1, while in other kernels first vector labelled -1. suggests libsvm relabels of vectors.

is there way prevent or simple way work around it?

you discovered libsvm uses label -1 whatever label encounters first. reason is, allows arbitrary labels , changes them -1 , +1 according order in appear in label vector.

so can either check directly or @ model returned libsvm. contains entry called label vector containing order in libsvm encountered labels. can use information switch sign of scores.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -