MATLAB: Hello dear, i want to separate training data & testing data in matlab.but how? anyone please help me

neural networktraning & testing

how i can separate training data & testing data in matlab(Neural network)

Best Answer

Why did you neglect to mention validation data ???
Validation data is important because it prevents the net from losing it's ability to work well with nontraining (i.e, validation, testing and unseen) data.
When MATLAB nets are trained they automatically divide the data randomly into training, validation and testing subsets with the ratio 0.7/.0.15/.0.15.
To find which data belongs to which subset, use the training record, tr obtained via the commands
[ net tr output error ] = train( net, input, target);
trnind = tr.trainInd
valind = tr.valInd
tstind = tr.testInd
However, you can divide the data any way you want via commands DIVIDETRAIN, DIVIDEBLOCK, DIVIDEIND, DIVIDEINT to replace the default DIVIDERAND.
To investigate the documentation for any function or command use the commands HELP and DOC.
To replace the default DIVIDERAND, use, for example, the command
net.divideFcn = 'divideint';
Hope this helps
Thank you for formally accepting my answer
Greg