资源简介
接受者操作特性曲线 (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代码
相关资源
- sutton强化学习随书MATLAB代码
- 无控纵向导弹弹道计算
- 层次分析法的matlab程序
- MATLAB烟花算法源代码
- OFDM通信系统matlab实现
- MATLAB的S-Function编写指导
- matlab实现对两幅图像的叠加
- 织物密度测量MATLAB实现
- pca源码matlab
- lvq学习算法源码matlab
- FBMC OQAM matlab code
- 基于matlab的判决反馈的均衡器
- 泊松过程的模拟及检验 matlab程序
- 小卫星多普勒频偏MATLAB仿真程序及参
- MATLAB R2007基础教程刘慧颖 编著--源代
- EMD 算法MATLAB 程序
- 基于颜色的聚类分割matlab
- MATLAB电机仿真精华50例
- MATLAB电机仿真精华50例PDF+源码
- 基于Matlab的OFDM系统仿真的设计
- 用于研究非线性系统matlab模块
- 世上最牛的23个图像跟踪算法MATLAB程序
- 压缩鬼成像matlab代码
- HHT变换的三种方法 Matlab,包含CMD分解
- 数理统计与MATLAB工程数据分析(PDF+随
- matlab2007B数模乘公交看奥运_搜索法+
- MATLAB 提取Gabor特征
- Matlab电机仿真实例230692
- 散点拟合平面的MATLAB程序
- matlab最速下降法与牛顿法结合求解函
评论
共有 条评论