MATLAB: How to do cross-validation and calculate the optimum number of hidden neurons in the Neural Networks Toolbox 7.0.2 (R2011b)

Deep Learning Toolbox

How can I do the following in the Neural Networks Toolbox:
1. K-fold cross validation instead of random partition of data. I know that I can do it using specific code, but is this built in to the NNTOOL?
2. Calculate the optimum number of hidden neurons automatically during training of the neural network.

Best Answer

The ability to use k-fold cross validation instead of random partitioning, or to calculate the optimum number of hidden neurons during training, are not available in NNTOOL. As a workaround for cross-validation, you can use CVPARTITION in the Statistics Toolbox.