0
votes

Currently I am using libsvm 3.18 to do multi-class classification with probability-estimates. So does it require to:

  1. normalize the labels. For examples, I have data with 3 labels: 120, 125, 131, and do I have to convert them to 0, 1, 2?

  2. sort the data by labels?

OpenCV's SVM has some code to 'prepare the data', looks like it did the above two things so I am asking if it is also the case when using libsvm

1

1 Answers

0
votes

libSVM doesn't need to change the labels of data or sort data. First you need to transform the data format in such way: Label 1:value 2:value ... Then normalize the input data, for example using svm-scale provided in libSVM to scale each dimension of data. Now you can use SVM to train the model. For more detailed instruction you can check http://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf .