📄 subsc.m
字号:
%SUBSC Subspace Classifier%% W = subsc(A,n)%% n-dimensional subspace maps are computed for each class of the dataset A% using PCA, such that they contain the origin. All object in A are normalized% first on unit length.%% W = subsc(A,alf)%% Subspaces of different dimensionality are determined, each explaining at% least a fraction alf of the class variance.%% See datasets, mappings, fisherc, fisherm, klm, subsm% 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 = subsc(a,n);if nargin < 2, n = 1; endif nargin < 1 | isempty(a) % handle untrained calls W = mapping('subsc',n); returnend[nlab,lablist,m,k,c,p] = dataset(a);if isa(n,'double') % training W = {}; N = zeros(1,c); for j = 1:c J = find(nlab==j); [w,nn] = subsm(+a(J,:),n); W = [W,{w}]; N(j) = nn; end W = mapping('subsc',W,lablist,k,c,1); W = cnormc(W,a);elseif isa(n,'mapping') % testing [W,classlist,type,k,c] = mapping(n); b = zeros(size(a,1),c); for j = 1:c d = a*normm(2)*W{j}; b(:,j) = sqrt(sum(d.*d,2)); end b = b ./ repmat(sum(b,2),1,c); W = dataset(invsig(b),getlab(a),classlist,p,lablist);else error('error')end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -