简体   繁体   English

如何获得SVM精度?

[英]How to obtain SVM accuracy?

I have a SVM running to classify a huge load of feature vectors. 我正在运行SVM来对大量特征向量进行分类。 It's been trained with around 1 million feature vectors. 已经使用了大约一百万个特征向量对其进行了训练。 I use the OpenCV SVM class for that. 我为此使用OpenCV SVM类。 How do I measure the accuracy of the trained SVM? 如何测量经过训练的SVM的准确性?

On this page I read: 此页面上,我阅读:

>>> pred_lbl, pred_acc, pred_val = svm_predict(c_test,d_test,m) Accuracy = 76.6667% (46/60) (classification)

Even though there libsvm have been used, I think OpenCV just wraps libsvm classes. 即使已经使用过libsvm,但我认为OpenCV只是包装了libsvm类。 Am I right? 我对吗? What I'm driving at is that there is maybe such a return value possible in OpenCV aswell. 我要说的是,OpenCV中也可能有这样的返回值。

As you can read on the webpage, he runs a grid search to obtain the best svm parameters. 正如您在网页上可以看到的那样,他进行了网格搜索以获取最佳的svm参数。 The best parameterset is obtained when accuracy is maximized ( p_acc[0] ). 当精度最大时( p_acc[0] ),可获得最佳参数集。

Or do I have to handlabel all feature vectors to get some sort of ground truth with which i could estimate the accuracy? 还是我必须手动标记所有特征向量以获得某种基础事实,我可以以此来估计准确性? This would be quite alot of work and would love to avoid it. 这将是很多工作,并且希望避免这样做。

I've also seen some similar questions here, but no clear answer to my question. 我在这里也看到了一些类似的问题,但是我的问题没有明确的答案。 Thanks in advance! 提前致谢!

您可以通过保留一些数据(而不是将其用于训练)并在该数据上测量模型的性能来测量准确性。

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

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