Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R或matlab中精度召回曲线下的面积_Matlab_Classification - Fatal编程技术网

R或matlab中精度召回曲线下的面积

R或matlab中精度召回曲线下的面积,matlab,classification,Matlab,Classification,我有一系列二元目标的预测分数。使用R或matlab计算精确召回曲线下面积的最佳方法是什么 我对此做了一些搜索,没有找到任何相关函数/库来完成此任务。这似乎很奇怪,因为这应该是人们经常做的事情。不知道我是否错过了什么。任何帮助都将不胜感激。以下是matlab实现 function auc = scoreAUC(category,posterior) % auc = scoreAUC(category,posterior) % % Calculates the area under the ROC

我有一系列二元目标的预测分数。使用R或matlab计算精确召回曲线下面积的最佳方法是什么


我对此做了一些搜索,没有找到任何相关函数/库来完成此任务。这似乎很奇怪,因为这应该是人们经常做的事情。不知道我是否错过了什么。任何帮助都将不胜感激。

以下是matlab实现

function auc = scoreAUC(category,posterior)
% auc = scoreAUC(category,posterior)
%
% Calculates the area under the ROC for a given set
% of posterior predictions and labels. Currently limited to two classes.
%
% posterior: n1 matrix of posterior probabilities for class 1
% category: n1 matrix of categories {0,1}
% auc: Area under the curve
%
% Author: Benjamin Hamner
% Date Modified: October 14, 2010
%
% Algorithm found in
% A Simple Generalisation of the Area Under the ROC
% Curve for Multiple Class Classification Problems
% David Hand and Robert Till
% http://www.springerlink.com/content/nn141j42838n7u21/fulltext.pdf

r = tiedrank(posterior);
auc = (sum(r(category==1)) - sum(category==1) * (sum(category==1)+1)/2) / ...
( sum(category<1) * sum(category==1));
函数auc=scoreAUC(类别,后)
%auc=得分auc(类别,后)
%
%计算给定集合的ROC下的面积
%关于后验预测和标签。目前仅限于两类。
%
%后验概率:1类后验概率的n1矩阵
%范畴{0,1}范畴的n1矩阵
%auc:曲线下的面积
%
%作者:本杰明·哈姆纳
%修改日期:2010年10月14日
%
%在中找到的算法
%对中华民国管辖地区的简单概括
%多类分类问题的曲线
%大卫·汉德和罗伯特·蒂尔
% http://www.springerlink.com/content/nn141j42838n7u21/fulltext.pdf
r=第二个(后);
auc=(总和(r(类别==1))-总和(类别==1)*(总和(类别==1)+1)/2/。。。
(总数(类别)