modlrder.m

来自「偏最小二乘算法在MATLAB中的实现」· M 代码 · 共 76 行

M
76
字号
function modlrder(model)
%MODLRDER Prints out parameters of models created by MODLMKER and MODLGUI
%  This function "reads" the models created by the PLS_Toolbox
%  functions MODLMKER and MODLGUI, and prints the date and time created
%  and methods used in creation of the model to the screen.
%  The input to the function is the PCA or regression model in
%  matrix form (model) created by MODLMKER or MODLGUI. There is no output. 
%  The I/O format is: modlrder(model)

%  Copyright
%  Barry M. Wise
%  1994
%  Modified February 1995
disp('  ')
if model(1,9) == 0
  disp('This is a PCA model')
else
  disp('This is a regression model')
end
s = sprintf('Model was created on %g/%g/%g',model(1,2), ...
model(1,3),model(1,1));
disp('  '), disp(s)
s = sprintf('at a time of %g:%g:%g',model(1,4), ...
model(1,5),model(1,6));
disp(s), disp('  ')
s = sprintf('The X-block was %g by %g',model(1,7),model(1,8));
disp(s)
if model(1,9) ~= 0
  s = sprintf('The Y-block was %g by %g',model(1,9),model(1,10));
  disp(s), disp('  ')
end
if model(1,12) == 1
  disp('The model data was not scaled')
elseif model(1,12) == 2
  disp('The model data was mean centered')
elseif model(1,12) == 3
  disp('The model data was autoscaled')
end
if model(1,9) == 0
  s = sprintf('The PCA model was created using %g PCs', ...
  model(1,14));
  disp(s)
elseif model(1,11) == 1
  s = sprintf('The model was created using PCR with %g PCs', ...
  model(1,14));
  disp(s)
elseif model(1,11) == 2
  s = sprintf('The model was created using PLS with %g LVs', ...
  model(1,14));
  disp(s)
elseif model(1,11) == 3
  s = sprintf('The model was created using RR with theta = %g', ...
  model(1,14));
  disp(s)
end
if model(1,9) ~=0
  if model(1,11) ~= 3
    if model(1,13) == 1
      disp('Venetian blinds cross validation was used')
    elseif model(1,13) == 2
      disp('Leave one out cross validation was used')
    elseif model(1,13) == 3
      disp('Contiguous block cross validation was used')
    elseif model(1,13) == 4
      disp('Random block cross validation was used')
    end
  elseif model(1,11) == 3
    if model(1,13) == 1
      disp('Hoerl Kennard estimate of ridge parameter was used')
    elseif model(1,13) == 2
      disp('Venetian blinds cross validation was used')
    end
  end
end
disp('  ')

⌨️ 快捷键说明

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