⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rocc.m

📁 这是一些关于模式识别工具箱的源代码,和模式识别第二版配套使用
💻 M
字号:
function [false_alarm, hit] = ROCC(patterns, targets)

%Generate a receiver operating characteristic curve (ROCC) for 1-D data
%Inputs:
%	patterns	- The data from which to estimate
%	targets     - The class for each of the patterns
%Outputs:
%	false_alarm, hit - The x and y axes for the ROCC. 
%	If the function is called without output, the ROCC is plotted

Nbins       = max(3,floor(length(patterns).^(1/3)));
indice0		= find(targets ~= 1);
indice1		= find(targets == 1);
range		= [min(patterns), max(patterns)];

p0          = high_histogram(patterns(:,indice0),Nbins,range);
p1          = high_histogram(patterns(:,indice1),Nbins,range);

p0			= p0 ./ sum(p0);
p1			= p1 ./ sum(p1);

false_alarm = 1-cumsum(p0);
hit			= 1-cumsum(p1);

if (nargout == 0),
   figure
   plot(false_alarm, hit)
   xlabel('False alarm')
   ylabel('Hit rate')
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -