资源简介
接受者操作特性曲线 (receiver operating characteristic curve,简称ROC曲线),又称为感受性曲线(sensitivity curve)。得此名的原因在于曲线上各点反映着相同的感受性,它们都是对同一信号刺激的反应,只不过是在几种不同的判定标准下所得的结果而已。接受者操作特性曲线就是以虚惊概率为横轴,击中概率为纵轴所组成的坐标图,和被试在特定刺激条件下由于采用不同的判断标准得出的不同结果画出的曲线。

代码片段和文件信息
function ROCdata=roc(varargin)
% ROC - Receiver Operating Characteristics.
% The ROC graphs are a useful tecnique for organizing classifiers and
% visualizing their performance. ROC graphs are commonly used in medical
% decision making.
% If you have downloaded partest
% http://www.mathworks.com/matlabcentral/fileexchange/12705
% the routine will compute several data on test performance.
%
% Syntax: roc(xalpha)
%
% Input: x - This is the data matrix. The first column is the column of the data value;
% The second column is the column of the tag: unhealthy (1) and
% healthy (0).
% alpha - significance level (default 0.05)
%
% Output: The ROC plot;
% The Area under the curve with Standard error and Confidence
% interval and comment.
% Cut-off point for best sensitivity and specificity.
% (Optional) the test performances at cut-off point.
%
% Example:
% load rocdata
% roc(x)
%
% Created by Giuseppe Cardillo
% giuseppe.cardillo-edta@poste.it
%
% To cite this file this would be an appropriate format:
% Cardillo G. (2008) ROC curve: compute a Receiver Operating Characteristics curve.
% http://www.mathworks.com/matlabcentral/fileexchange/19950
%Input Error handling
args=cell(varargin);
nu=numel(args);
if isempty(nu)
error(‘Warning: almost the data matrix is required‘)
elseif nu>3
error(‘Warning: Max three input data are required‘)
end
default.values = {[]0.051};
default.values(1:nu) = args;
[x alpha verbose] = deal(default.values{:});
if isvector(x)
error(‘Warning: X must be a matrix‘)
end
if ~all(isfinite(x(:))) || ~all(isnumeric(x(:)))
error(‘Warning: all X values must be numeric and finite‘)
end
x(:2)=logical(x(:2));
if all(x(:2)==0)
error(‘Warning: there are only healthy subjects!‘)
end
if all(x(:2)==1)
error(‘Warning: there are only unhealthy subjects!‘)
end
if nu>=2
if ~isscalar(alpha) || ~isnumeric(alpha) || ~isfinite(alpha) || isempty(alpha)
error(‘Warning: it is required a numeric finite and scalar ALPHA value.‘);
end
if alpha <= 0 || alpha >= 1 %check if alpha is between 0 and 1
error(‘Warning: ALPHA must be comprised between 0 and 1.‘)
end
if nu==3
verbose=logical(verbose);
end
end
clear args default nu
tr=repmat(‘-‘180);
lu=length(x(x(:2)==1)); %number of unhealthy subjects
lh=length(x(x(:2)==0)); %number of healthy subjects
z=sortrows(x1);
%find unique values in z
labels=unique(z(:1));
ll=length(labels); %count unique value
a=zeros(ll2); %array preallocation
ubar=mean(x(x(:2)==1)1); %unhealthy mean value
hbar=mean(x(x(:2)==0)1); %healthy mean value
for K=1:ll
if hbar TP=length(x(x(:2)==1 & x(:1)>labels(K)));
FP=length(x(x(:2)==0 & x(:1)>labels(K)));
FN=length(x(x(:2)==1 & x(:1)<=labels(K)));
TN=length(x(x(:2)==0 & x(:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1338 2010-04-08 13:00 license.txt
文件 7911 2010-04-08 12:49 roc.m
文件 351 2009-02-16 15:52 rocdata.mat
- 上一篇:无控纵向导弹弹道计算
- 下一篇:sutton强化学习随书MATLAB代码
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论