> How to only use training set to train Neural Network using toolbox with "divideInd" option
> Asked by Gary 22 minutes ago
> Latest activity Edited by Gary 15 minutes ago
> Hello all, currently I am working with the Neural Network toolbox. I used the "Generate Advanced Script" option at the end and made some modifications as to how the network is to divide up my data set into training, validation, and testing. I changed the default option from "dividerand" to "divideInd" and I specified which indices I wanted to be in training, validation, and testing.
Your technique results in unnecessary specifications of too many net properties that are already defaults. Concentrate on the defaults that have to be overridden. For example, if you have a classification or pattern recognition problem, first use the default number of hidden nodes and omit the ending semicolon to obtain
net = patternnet % No semicolon
The resulting command line printout will reveal the defaults. You can then concentrate on the defaults you want to override.
It is also useful to run the code examples in the documentation
help patternnet
doc patternnet
Be sure the target matrix consists of unit vector columns with a single "1". The row index of the "1" denotes the class index of the corresponding input column. The relationship between the target matrix and the class indices is given by
target = ind2vec(trueclassindex)
trueclassindex = vec2ind(target)
Again, omitting some of the ending semicolons will reveal useful information.
You are confused.
data = design + test
design = train+ validation
The train function designs with design data and evaluates with nondesign test data. It trains with training data, but uses the nontraining validation data to stop training if the validation error does not decrease for max_fail consecutive epochs. Finally, it evaluates the net with nondesign test data.
The separate trn/val/tst performances can be obtained using the training record tr via
[net tr y e ] = train(net,input,target); tr = tr % NO SEMICOLON
For examples, search the NEWSGROUP and ANSWERS using
patternnet greg
% Also is there a way to check the confusion matrix for EACH individual set? (meaning confusion matrix using only training, validation, testing set)
Yes. Call each separately after using the indices to separate the cases. For an example search
confusion greg
Hope this helps.
Thank you for formally accepting my answer
Greg
Best Answer