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

📄 cnormc.m

📁 模式识别工具包
💻 M
字号:
%CNORMC Classifier normalisation for good posteriori probabilities% % 	W = cnormc(W,A)% % The mapping W is scaled according to the dataset A  in such a % way that A*W*classc represents as good as possible the posteriori % probabilities. This is done by a multiplicative scaling on the % classifier outputs such that the sigmoid outputs added by classc % yield a maximum likelihood result on A. This does not influence % the decision boundary itself.% % See also datasets, mappings, loglc % 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 W = cnormc(W,A)if isempty(W)	W = mapping('cnormc','combiner',A);	returnendif ~isa(W,'mapping')	error('First argument should be a mapping')end[nlab,lablist,m,k,c,p] = dataset(A);classbit = isclassifier(W);W = setclass(W,0);x = double(A*W);if c == 2 & size(x,2) == 1, x = [x -x]; end	% alf is used for an automatic regularization, important for	% non-overlapping classesalf = 1e-7;v = 1e-10; L = -inf; Lnew = -realmax;if isa(nlab,'dataset')	xx = +sum(x.*nlab,2);	while abs(Lnew - L) > 1e-6;		pax = sigm(xx*v); pbx = 1 - pax; vv= v + 1;		L = Lnew; Lnew = mean(log(pax+realmin))-alf*log(vv);		v = (pbx' * xx - alf*m/vv) / ...			((xx.*pax)'*(xx.*pbx) - m*alf/(vv*vv) +realmin) + v;	endelse	xx = x(m*nlab-m+[1:m]');	while abs(Lnew - L) > 1e-6;		pax = sigm(xx*v); pbx = 1 - pax; vv= v + 1;		L = Lnew; Lnew = mean(p(nlab).*log(pax+realmin))-alf*log(vv);		v = ((p(nlab).*pbx)' * xx - alf*m/vv) / ...		    ((p(nlab).*xx.*pax)'*(xx.*pbx) - m*alf/(vv*vv) +realmin) + v;	endendW = setclass(W,classbit);W = W.* max(v,0.1/(std(xx)+1e-16));

⌨️ 快捷键说明

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