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

📄 normal_map.m

📁 模式识别matlab工具包
💻 M
字号:
%NORMAL_MAP Map a dataset on a normal densities based classifier% % 	F = normal_map(A,W)% % Maps the dataset A by the normal densities based classfier W on a % [0,1] interval for each of the classes W is trained on. This routine% is automatically called for computing A*W if W is a normal density% based classifier.% A*W*sigm   or F*sigm   generates 0-1 scaled densities weighted by%                        the class prior probabilities.% A*W*classc or F*classc generates normalized posterior probabilities.%% scatterd(A); plotm(F*sigm) plots density contour lines.% % See also mappings, datasets, udc, ldc, qdc, nbayesc, plotm% 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 F = normal_map(A,W)[w,classlist,type,k,c,v,par] = mapping(W);deg = ndims(w{2})-1;U = +w{1}; G = w{2}; p = w{3};[m,ka] = size(A);if ka ~= k, error('Wrong feature size'); endF = zeros(m,c);if deg == 1	H = G;	if rank(H) < size(H,1)		E = real(pinv(H));	else		E = real(inv(H));	endendCmax = -inf;for i=1:c	X = +A - ones(m,1)*U(i,:);	if deg == 2		H = G(:,:,i);		if rank(H) < size(H,1)			E = real(pinv(H));		else			E = real(inv(H));		end	end	C = log(p(i)) - 0.5*(sum(log(real(eig(H))+realmin)) + log(2*pi));	Cmax = max(C,Cmax);	F(:,i) = (C - sum(X'.*(E*X'),1).*0.5)'; endF = F - Cmax; % take care of scaling on 0-1F = exp(F) + realmin;F = invsig(F);[nlab,lablist,m,k,c,p,classlista,imheight] = dataset(A);if imheight > 0, imheight = 0; endF = dataset(F,getlab(A),classlist,p,lablist,imheight);return

⌨️ 快捷键说明

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