function srd=srdMasterDemo(k)
%==========================================================================
% k is in {1,2,3,4,5,6,7} => No cross-validation scenarios
% k is in {11,21,22,23,24,25,26} => Classical cross validation
% k is in {101,102,103,104} => Leave multiple out cross validation
%==========================================================================
%
% Load the 100 x 40 matrix of RMSECV values. This will be the input
% matrix that SRD values will be computed on.
%
load CAIDataAndCV;
res=outplsCA1Cal60CV100;
%
% Select case
%
close all;
switch k
%----------------------------------------------------------------------
% CASES 1 & 2:
% Since A has more than 10 rows, the normal approximation
% of the SRD distribution *must* be used in MATLAB.
%----------------------------------------------------------------------
case {1,2}
A=res.rmsecv'; % Merits
if k==1, T='min'; else T=min(A,[],2); end; % Target
exact=false; % Normal Approximation
cv='none'; % No CV
srd=srdMaster(A,T,exact,cv);
%----------------------------------------------------------------------
% CASES 3 & 4:
% In this case, I have articially truncated A to have 10 rows. As a
% result, one can cpmpare the exact SRD distribution (k==3) versus
% the normal approximation to the SRD distribution (k==4)
%----------------------------------------------------------------------
case {3,4}
A=res.rmsecv'; A=A(1:10,:);
T=min(A,[],2);
if k==3, exact=true; else exact=false; end;
cv='none';
srd=srdMaster(A,T,exact,cv);
%----------------------------------------------------------------------
% CASES 5 & 6:
% Stacking of different merits
%----------------------------------------------------------------------
case {5,6}
switch k
case 5, A={res.rmsecv',1-res.R2val'}; T={'min','min'};
case 6, A={res.rmsecv', res.R2val'}; T={'min','max'};
end
exact=false;
cv='none';
srd=srdMaster(A,T,exact,cv);
%----------------------------------------------------------------------
% CASE 7:
% Use 1 - R2 values
%----------------------------------------------------------------------
case 7
A=1-res.R2val';
T='min';
exact=false;
cv='none';
srd=srdMaster(A,T,exact,cv);
%----------------------------------------------------------------------
% CASE 11:
% We examine 5-fold cross-validation (CV). This is the same
% as case 1 except that we use CV instead.
%----------------------------------------------------------------------
case 11
A=res.rmsecv';
T='min';
exact=false;
cv='classic';
nFold=5;
srd=srdMaster(A,T,exact,cv,nFold);
%----------------------------------------------------------------------
% CASES 21-26: STACKING with 5-fold CV.
%----------------------------------------------------------------------
case {21,22,23,24,25,26}
switch k
case 21
A={1-res.R2cal',1-res.R2val'};
T={'min','min'};
case 22
A={res.R2cal',res.R2val'};
T={'max','max'};
case 23
A={res.rmsecv',1-res.R2val'};
T={'min','min'};
case 24
A={res.rmsecv',res.R2val'};
T={'min','max'};
case 25
A={res.rmsecv',res.rmsec',1-res.R2cal',1-res.R2val'};
T='min';
case 26
A={res.rmsecv',res.rmsec',res.R2cal',res.R2val'};
T={'min','min','max','max'};
end
exact=false;
cv='classic';
nFold=5;
srd=srdMaster(A,T,exact,cv,nFold);
%----------------------------------------------------------------------
% CASES 31: STACKING whose blocks have rows of *unequal* size
%----------------------------------------------------------------------
case 31
A={1-res.R2cal(:,1:80)',1-res.R2val(:,1:63)'};
T={'min','min'};
exact=false;
cv='classic';
nFold=5;
srd=srdMaster(A,T,exact,cv,nFold);
%----------------------------------------------------------------------
% CASE 101:
% Similar to case 11 except that we are using many LMO iterations
%----------------------------------------------------------------------
case 101
A=res.rmsecv';
T='min';
exact=false;
cv='lmo';
nIteration=20;
percent=60;
srd=srdMaster(A,T,exact,cv,nIteration,percent);
%----------------------------------------------------------------------
% CASES 102: STACKING whose blocks have rows of equal size
%----------------------------------------------------------------------
case 102
A={1-res.R2cal',1-res.R2val'};
T={'min','min'};
exact=false;
cv='lmo';
nIteration=10;
percent=75;
allMix=false;
srd=srdMaster(A,T,exact,cv,nIteration,percent,allMix);
%----------------------------------------------------------------------
% CASES 103: same as case 102 except allMix=true
%----------------------------------------------------------------------
case 103
A={1-res.R2cal',1-res.R2val'};
T={'min','min'};
exact=false;
cv='lmo';
nIteration=10;
percent=75;
allMix=true;
srd=srdMaster(A,T,exact,cv,nIteration,percent,allMix);
%----------------------------------------------------------------------
% CASES 104: STACKING whose blocks have rows of *unequal* size
%----------------------------------------------------------------------
case 104
A={1-res.R2cal(:,1:80)',1-res.R2val(:,1:63)'};
T={'min','min'};
exact=false;
cv='lmo';
nIteration=10;
percent=50;
srd=srdMaster(A,T,exact,cv,nIteration,percent);
otherwise
error('Illegal case selection for k.')
end
%
% Plot the SRDs
%
srdPlots(srd);
%==========================================================================
end
没有合适的资源?快使用搜索试试~ 我知道了~
SRD.zip_mapca.zip_光谱_光谱奇异值_红外光谱_近红外
共8个文件
m:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 86 浏览量
2022-09-24
22:15:02
上传
评论
收藏 10KB ZIP 举报
温馨提示
SRD的方法识别近红外光谱中奇异值,经典方法
资源推荐
资源详情
资源评论
收起资源包目录
SRD.zip (8个子文件)
SRD
srdCV.m 4KB
srdStack.m 904B
srdPreProcess.m 4KB
srdMaster.m 6KB
srdPlots.m 2KB
srdMasterDemo.m 7KB
srdMatrix.m 3KB
srdPostProcess.m 1KB
共 8 条
- 1
资源评论
御道御小黑
- 粉丝: 61
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功