首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用支持向量机计算准确率、召回率和准确率

使用支持向量机计算准确率、召回率和准确率
EN

Stack Overflow用户
提问于 2015-09-09 20:47:20
回答 1查看 1.8K关注 0票数 1

我已经在matlab中训练了支持向量机,然后我将我的模型转移到OpenCV中来检测汽车的尾部。下面是代码。

代码语言:javascript
复制
pos_mat = matfile('posfeat.mat');               % positive samples
neg_mat = matfile('negfeat.mat');               % negative samples

posRow  = pos_mat.bigmat;                        % get positve samples
negRow  = neg_mat.bigmatneg;                     % get negative samples

group = ones(135,1);                             % get labels
group(70:135) = -1;

t = 70;
for i =1:1:66
    posRow(t,:) = (negRow(i,:));
    t = t+1;
end
xdata = posRow;


SVMModel = fitcsvm(xdata,group);

beta = (SVMModel.Beta)';

以下是输出。

现在我要计算SVM分类器的准确率、召回率和准确率。这个post非常有用,但它只提供了与精确度、召回率、准确度相关的概念。有人能帮我计算支持向量机分类器的准确率,召回率,准确率吗?你可以找到posfeat和negfeat here

EN

回答 1

Stack Overflow用户

发布于 2016-08-21 01:44:38

根据

https://www.csie.ntu.edu.tw/~cjlin/libsvm/

此工具中包含的评估函数包括:

代码语言:javascript
复制
precision
Precision = true_positive / (true_positive + false_positive)
recall
Recall = true_positive / (true_positive + false_negative)
fscore
F-score = 2 * Precision * Recall / (Precision + Recall)
bac
BAC (Balanced ACcuracy) = (Sensitivity + Specificity) / 2,
where Sensitivity = true_positive / (true_positive + false_negative)
and   Specificity = true_negative / (true_negative + false_positive)
auc
AUC (Area Under Curve) is the area under the ROC curve.

注意:此工具仅适用于标签为{1,-1}的二进制类C-SVM。不支持多类、回归和概率估计。注意:当使用准确度作为评估标准时,交叉验证精度可能与标准LIBSVM的交叉验证精度不同。原因是LIBSVM在内部对同一类中的数据进行分组,而此工具不会。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32479960

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档