How to get validation test and training errors of a neural network?

Technical Source
2 min readJun 18, 2021

--

I have created and trained a neural network using the following code .I want to know how to get the training testing and validation errors/mis-classifications the way we get using the matlab GUI.

trainFcn = 'trainscg';  % Scaled conjugate gradient backpropagation.   % Create a Pattern Recognition Network
hiddenLayerSize = 25;
net = patternnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = trainper/100;
net.divideParam.valRatio = valper/100;
net.divideParam.testRatio = testper/100;
% Train the Network
[net,tr] = train(net,x,t);

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

BOTH documentation commands

help patternnet
and
doc patternnet

have the following sample code for CLASSIFICATION & PATTERN-RECOGNITION:

[x,t] = iris_dataset;
net = patternnet(10);
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,t,y);
classes = vec2ind(y);

However, the following are missing

1. Dimensions of x and t 
2. Plots of x, t, and t vs x
3. Minimum possible number of hidden nodes
4. Initial state of the RNG (Needed for duplication)
5. Training record, tr

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet