⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 somplscrossval.m

📁 有监督自组织映射-偏最小二乘算法(A supervised self-organising map–partial least squares algorithm),可以用语多变量数据的回归分析
💻 M
字号:
function [PCTrain,PCTest,NBestMLK,NMLKP,OPT] = SOMPLSCrossVal(Nval,Percentage,BestMLK);
%
% Author:   Willem Melssen, Radboud University Nijmegen, the Netherlands
% Date:     18-12-2005
% Version:  1.1
%
% Format:
% [PCTrain,PCTest,NBestMLK,NMLKP,OPT] = SOMPLSCrossVal(Nval,Percentage,BestMLK);
%
% Input arguments:
% Nval:         number of crossvalidations
% Percentage:   percentage of input data used for the training set
% BestMLK:      struct containing a.o. the input data and some performance attributes
%
% Output arguments:
% PCTrain:      overall perfermance for the training set 
% PCTest:       overall performance for the test set
% NBestMLK:     struct containing the optimised MLZ model
% NMLKP:        struct containing the fixed MLZ parameters
% OPT:          struct containing the optimised MLZ parameters

% set cputimer
Tbegin=cputime;
MLKP=SetParamsModel;
MLKP.SilentMode='Y';
if (upper(MLKP.ProblemType) == 'REG' & upper(MLKP.OptMode) == 'IND')
    % optimise SOMPLS regression model per variable
    [NvarY,Nunits]=size(BestMLK.YMap);
    SavMLK=BestMLK;
    for ivar=1:NvarY
        BestMLK.Ytr=SavMLK.Ytr(:,ivar);
        BestMLK.Ytest=SavMLK.Ytest(:,ivar);
        [OPT(ivar)] = SOMPLSOptimise(Nval,Percentage,BestMLK,MLKP);
        [PCTrain,PCTest,NBestMLK(ivar),NMLKP] = SOMPLSValModel(BestMLK,MLKP,OPT(ivar));
    end
else
    % optimise SOMPLS classification or regression model for all variables at once
    [OPT] = SOMPLSOptimise(Nval,Percentage,BestMLK,MLKP);
    [PCTrain,PCTest,NBestMLK,NMLKP] = SOMPLSValModel(BestMLK,MLKP,OPT);
end
% read out cputimer
Tend=cputime;
Message=sprintf('Total time %g seconds',Tend-Tbegin);
disp(Message);

⌨️ 快捷键说明

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