cross validation in neural network

Illustration
faizan_malik - 2022-04-21T14:14:24+00:00
Question: cross validation in neural network

i need some clarification on cross validation to be applied to neural network. i manage to get result of NN. right now i plan to apply cross validation for model selection.   i have go through example of *crossvalind, crossval* but i dont really understand what is classifier,in other word, what are the main things to be considered in order to apply cross validation.    

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

What do you mean by "model selection" ... making a choice between newrb and fitnet(regression) or patternnet(classification)? Or, given one of them with one hidden layer, choosing the minimum number of hidden nodes that can achieve the design goal?
 
I do not have crossvalind and haven't figured out how to use crossval for neural nets yet.
 
If I were in a hurry, I would just use randperm(N) to randomly divide the N cases of input/target pairs into 10 mutually exclusive subsets. Then use subset i (i=1:10), for testing, subset j (j ~= i) for validation and the remaining eight subsets for training. There is no need to shuffle data around because it can all be done with indexing.
 
With 10-fold XVAL there are 10*9 = 90 combinations for validation and test subset pairs. However, only 10 are needed. Therefore, there is no need to use both combinations (i,j) and (j,i). This reduces the number to 45. However, since the subsets are random, it is sufficient to use j = mod(i+1,10).
 
I would then tabulate the separate train/val/test performances as well as their summary statistics.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!