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

📄 multiway_check.m

📁 MOLMAP multiway toolbox是一个matlab集成工具箱
💻 M
字号:
function errortype = multiway_check(X,settings,model,type)

% multiple checks for MOLMAP inputs
%
% see the HTML HELP files (help.htm) for details 
%
% The toolbox is freeware and may be used (but not modified) 
% if proper reference is given to the authors. Preferably refer to:
% D. Ballabio, V. Consonni, R. Todeschini
% Classification of multiway analytical data based on MOLMAP approach
% Analytica Chimica Acta, in press
% 
% version 1.0 - november 2007
% Davide Ballabio
% Milano Chemometrics and QSAR Research Group
% www.disat.unimib.it/chm


errortype = 'none';
switch type
    
    case {'model'}
        errortype = check_data(X,errortype);
        errortype = check_settings(settings,errortype);
        
    case {'pred'}
        errortype = check_layer(X,model,errortype);

end

% -------------------------------------------------------------------------


function errortype = check_data(X,errortype)

% data structure
if  ndims(X) < 3 | ndims(X) > 3                 
    errortype = 'input error: wrong data structure, data must be a 3 way data matrix';
    return
end

% -------------------------------------------------------------------------

function errortype = check_settings(settings,errortype)

if  isnan(settings.nsize)                 
    errortype = 'input error: the map size (settings.nsize) is not defined in the setting structure';
    return
end

if  isnan(settings.epochs)                 
    errortype = 'input error: the number of epochs (settings.epochs) is not defined in the setting structure';
    return
end

% -------------------------------------------------------------------------

function errortype = check_layer(X,model,errortype)

if  size(X,3) ~= size(model.net.W,3)                 
    errortype = 'input error: the number of variables in the last mode of X is different with respect to the number of layers in the model';
    return
end

⌨️ 快捷键说明

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