简体   繁体   中英

How to use svmpredict a matlab function which is found in libsvm

Introduction of My Project

I am currently using LIBSVM in matlab to train and test my data so that I can differentiate between photos/images taken by Amateur and Professional Photographer. My data are actually features such as RGB histogram, Spartial Edge Distribution and Repetition Identification. I have used 1040 images for training (50% are professional photos and 50% are amateur photos) and 210 images for testing (not labelled).

I need someone's help to clarify the following

  1. [predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model [, 'libsvm_options']); Is it correct for the testing_label_vector to be of any value(either +1 or -1) when performing testing?

  2. The value of accuracy according to page 8 of document http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf is given as Accuracy = # correctly predicted data / # total testing data so does that mean that I have to know the testing_label_vector when performing testing as I need to be able to judge if my predicted_label is same as the testing_label_vector in order to be justified the label as a "correctly predicted data"?

(1)

Yes, it is a vector of -1 and 1, that indicate what are the true labels of the data you are testing on (the data on training_instance_matrix).

(2)

Yes, you need to know the true label to be able to use the accuracy value returned by LIBSVM. If not you will get the decision of the SVM classifier (in predicted label) but the value returned by accuracy won't be anything useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM