MATLAB: I m working with JAFFE dataset.how to divide dataset into training and testing for neural network i m giving LBP feature of JAFFE images as a input.i have a code which divide 70% -30% ratio but how can i know that this 70% is for training,30%testin

% set up division of data for trainingtesting net.divideparam.trainratio = 70/100; net.divideparam.valratio = 15/100; net.divideparam.testratio = 15/100; %validation

inputs = arr;
% target1 = [1 0 0 0 0 0;0 1 0 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0;0 0 0 0 1 0;0 0 0 0 0 1];
% Create a Pattern Recognition Network hiddenLayerSize =26; net = patternnet(hiddenLayerSize); % Set up Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; % Train the Network [net, tr] = train(net,inputs,target2);
% Test the Network outputs = net(inputs); % errors = gsubtract(target1,outputs); % performance = perform(net,target1,outputs);
tInd = tr.testInd; tstOutputs = net(inputs(:,tInd)); tstPerform = perform(net,target2(:,tInd),tstOutputs);
% View the Network view(net) % %plot train state % figure,plottrainstate(tr); %plot confusion figure, plotconfusion(target2,outputs);

Best Answer

As the above code indicates, the default is 70/15/15 . To change it, just change the percentages in the above assignment statements. HOWEVER, I do not recommend changing it !!!
If you use 70/0/30, you are flirting with the potentially disastrous possibility of overtraining an overfit net (i.e., No. of unknown weights, and thresholds, Nw, exceeds the number of training equations Ntrneq)
To mitigate this without a validation set for a regression/curve-fitting net like FITNET, use MSEREG instead of MSE and/or TRAINBR instead of TRAINLM and/or No. of training equations Ntrneq >> No. of unknown weights and biases Nw
HOWEVER, it is not clear to me what to do for a classification/pattern-recognition net like PATTERNNET that uses CROSSENTROPY instead of MSE and TRAINSCG instead of TRAINLM.
[ I N ] = size(input)
[ O N ] = size(target)
Ntrneq = Ntrn*O
Nw = (I+1)*H+(H+1)*O
Obviously want
H << (Ntrn*O -O)/ (I+O+1)
Need size(input) to continue for overfitting check
Hope this helps
Thank you for formally accepting my answer
Greg