combine5.m

来自「用Cross validation的方法建立人工神经网络的模型!」· M 代码 · 共 32 行

M
32 行
字号
function [tr_val, test]=combine5(a1, a2, a3, a4, a5, i)

% Input: 5 equal-sized sub data sets: a1, a2, a3, a4, a5
%        the index of the dataset for testing: i
% Output:   tr_val: dataset combination for train and validation
%           test: dataset for testing
%


switch i
case 1
    tr_val=[a2; a3; a4; a5; ];
    test=a1;
case 2
    tr_val=[a1; a3; a4; a5; ];
    test=a2;
case 3
    tr_val=[a1; a2; a4; a5; ];
    test=a3;
case 4
    tr_val=[a1; a2; a3; a5; ];
    test=a4;
case 5
    tr_val=[a1; a2; a3; a4; ];
    test=a5;  
otherwise
    error('This is impossible')
end

return

⌨️ 快捷键说明

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