📄 杠杆点选样本的算法.txt
字号:
function [XSelected,XRest,vSelectedRowIndex]=LevSamplePartition(X,Num)
% LevSamplePartition selects the samples XSelected which uniformly distributed in the exprimental data X's space
% Input
% X:the matrix of the sample spectra
% Num:the number of the sample spectra you want select
% Output
% XSelected:the sample spectras was selected from the X
% XRest:the sample spectras remain int the X after select
% vSelectedRowIndex:the row index of the selected sample in the X matrix
% Programmer: zhimin zhang @ central south university on Nov 1 ,2007
% Reference: Y. Wang, D.J. Veltkamp and B.R. Kowalski, Anal. Chem., 63 (1991) 2750-2756.
[nRow,nCol]=size(X);
vAllSample=1:nRow;
Xtemp=X;
for i=1:Num
mHatMatrix=Xtemp*pinv(Xtemp);
[vMax,vIndex] = max(mHatMatrix);
[nMax,nIndex] = max(vMax);
vSelectedRowIndex(i)=vAllSample(vIndex(nIndex));
vCorrent=X(vAllSample(vIndex(nIndex)),:);
vAllSample=setdiff(vAllSample,vSelectedRowIndex);
Xtemp=[];
for j=1:length(vAllSample)
Xtemp(j,:)=Schmidt(vCorrent,X(vAllSample(j),:)) ;
end
end
for i=1:length(vSelectedRowIndex)
XSelected(i,:)=X(vSelectedRowIndex(i),:);
end
for i=1:length(vAllSample)
XRest(i,:)=X(vAllSample(i),:);
end
--
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -