www.pudn.com > RobustSF.zip > Copy_of_compute_classifier_parametrs.m, change:2014-07-16,size:326b


function [W] = Copy_of_compute_classifier_parametrs( Z1,tr_label) 
 
len1=length(tr_label); 
 
%% 制作训练样本中的标签矩阵H 
numclass=length(unique(tr_label)); 
H=zeros(numclass,len1); 
for il=1:len1 
    H(tr_label(il),il)=1; 
end 
 
%计算线性分类器W 
lambda=0.8; 
I=eye(size(Z1,1)); 
W=H*Z1'*inv((Z1*Z1'+lambda*I)); 
end