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

📄 roc.m

📁 模式识别 MATLAB 的工具箱,比较实用,包括SVM,ICA,PCA,NN等等模式识别算法.
💻 M
字号:
%ROC Receiver-operator curve% % 	e = roc(D,k)% % Computes k points of the receiver-operator curve of the classifier % W for the labeled data set D, which is typically the result of% D = A*W*classc, The curve is computed for k thresholds of the % aposteriori probabilities stored in D. The resulting error % frequencies for the two classes are stored in the two columns of % e, which may conveniently be plotted by plot2. Default k = 100% % See also datasets, mappings, reject, plot2% Copyright: R.P.W. Duin, duin@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsfunction e = roc(A,k);if nargin < 2, k = 100; endif nargin == 0 | isempty(A)	e = mapping('roc','fixed',k);	returnend[nlab,lablist,m,c,cc,p] = dataset(A);e1 = []; e2 = [];n = size(A,1);step = ceil(n/k);if step ~=1	k = k-1;endfor i=1:c	d = sort(+A(:,i));	n = length(d);	step = ceil(n/k);	nk = step*k-n;	nk1 = floor(nk/2);	nk2 = ceil(nk/2);	d = [repmat(d(1),nk1,1);d;repmat(d(end),nk2,1)];	d = reshape(d,step,k);	if step ~= 1		d = [d(1,:) d(end)];	end	n = length(d);	labo = repmat(A(:,i),1,n) > repmat(d,m,1);	q = repmat(nlab==i,1,n) ~= labo;	e1 = [e1; mean(q(find(nlab==i),:),1)];	e2 = [e2; mean(q(find(nlab~=i),:),1)];ende = [mean(e1,1); mean(e2,1)];

⌨️ 快捷键说明

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