Clear Filters
Clear Filters

How to disable validation and test data set in neural network

15 views (last 30 days)
I need to train patternnet neural network using all data set in the training set and avoiding validation check. I found two methods and they works very well in command line but not in a script returning very simple errors.
method 1:
mynet.divideFcn = '';
method 2:
mynet.divideParam.trainRatio = 1;
mynet.divideParam.valRatio = 0;
mynet.divideParam.testRatio = 0;
and the code:
Matlab R2012 b windows xp 32
Thanks !

Answers (2)

Greg Heath
Greg Heath on 14 Feb 2020
You have to define net before modifying any properties.
clear all, close all, clc
[x,t] = iris_dataset;
for i = 1:2
net = patternnet([]);
if i==1
net.divideFcn = '';
net.divideParam.trainRatio = 1;
net.divideParam.valRatio = 0;
net.divideParam.testRatio = 0;
net = train(net,x,t);
y = net(x);
MSE(i) = mse(y-t)
MSE = 0.0084 0.0084
Hope this helps.

Prasanth Sundaravelu
Prasanth Sundaravelu on 26 Apr 2018
Edited: Prasanth Sundaravelu on 26 Apr 2018
Hi, I think you need to type specific Divide function, instead of blank.
Try this : mynet.divideFcn = 'dividerand';

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!