Data Division in MATLAB Neural Network Train Command -
while training neural network in matlab using "train" command. command auto divide data training, testing, , validation sets or have divide data manually.
yes, does. can divide data manually, if want to. net.dividefcn
, net.divideparam
fields of net object should used:
t=0:0.05:8; x= sin(t); net = feedforwardnet(3); net.dividefcn= 'dividerand'; % divide data randomly net.divideparam.trainratio= 0.7; % use 70% of data training net.divideparam.valratio= 0.3; % 30% validation net.divideparam.testratio= 0; % 0% testing net = train(net,t,x); plot(t,x,t,net(t));
here example of manual data division:
net.dividefcn= 'divideind'; % divide data manually net.divideparam.trainind= 1:100; % training data indices net.divideparam.valind= 101:140; % validation data indices net.divideparam.testind= 141:161; % testing data indices
Comments
Post a Comment