fisherm.m

来自「模式识别matlab工具包」· M 代码 · 共 37 行

M
37
字号
%FISHERM Optimal discrimination mapping (Fisher mapping)%%       W = fisherm(A,n)%% Finds a mapping of the labeled dataset A to a n-dimensional% linear subspace such that it maximizes the the between scatter% over the within scatter (also called Fisher mapping).%% See also datasets, mappings, nlfisherm, klm% 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 = fisherm(a,n)if nargin == 1,  n = []; endif nargin == 0 | isempty(a)	W = mapping('fisherm',n);	returnend[nlab,lablist,m,k,c,p,featlist,imheight] = dataset(a);a = a*scalem(a); % set mean to originif isempty(n), n = min(k,c)-1; endif n >= m | n >= c	error('Dataset too small or or has too few classes for demanded output dimensionality')endw = klms(a);a = a*w;v = pca(meancov(a),n);if n == 0	W = v;else	W = w*v;	W = set(W,'p',imheight);endreturn

⌨️ 快捷键说明

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