简体   繁体   English

如何使用svmpredict在libsvm中找到的matlab函数

[英]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. 我目前在matlab中使用LIBSVM来训练和测试我的数据,这样我就可以区分业余和专业摄影师拍摄的照片/图像。 My data are actually features such as RGB histogram, Spartial Edge Distribution and Repetition Identification. 我的数据实际上是RGB直方图,Spartial Edge Distribution和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). 我使用了1040张图像进行训练(50%是专业照片,50%是业余照片)和210张图像用于测试(未标记)。

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']); [predict_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? test_label_vector在执行测试时是否具有任何值(+1或-1)是否正确?

  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"? 根据文档http://www.csie.ntu.edu.tw/~cjlin/papers/libsvm.pdf的第8页的准确度值给出为Accuracy =#正确预测的数据/#总测试数据, 这是否意味着我必须在执行测试时知道testing_label_vector,因为我需要能够判断我的predict_label是否与testing_label_vector相同,以便将标签称为“正确预测的数据”?

(1) (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). 是的,它是-1和1的向量,表示您正在测试的数据的真实标签(training_instance_matrix上的数据)。

(2) (2)

Yes, you need to know the true label to be able to use the accuracy value returned by LIBSVM. 是的,您需要知道真正的标签才能使用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. 如果不是,您将得到SVM分类器的决定(在预测标签中),但精确度返回的值将没有任何用处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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