Using 5-fold cross validation with neural networks
7 views (last 30 days)
Show older comments
Anthony Scicluna
on 26 Apr 2015
Commented: Yogini Prabhu
on 31 May 2021
I am trying to use k-fold with my neural networks to compare them with their 3 way split equivalents. I have a 150x4 dataset and since it is a very small amount I am trying to see whether 5-fold would allow the ANN to give better results since if I understood correctly Matlab will then pass 2 training sets 2 testing and a validation containing the respective number of rows after sorting the data randomly.
I have been going through some code examples however every time I try and implement a different example (from matlab or other websites) I either get an error using horzcat "Dimensions of matrices being concatenated are not consistent." or it doesn't work, which isn't making any sense since all 4 inputs and the output have 150x1 structure. I have tried applying k-fold to the individual columns (imported as a numeric matrix) and also as a collective matrix however all I get in the workspace are a testIdxs, a trainIdxs a and a k and an "Index exceeds matrix dimensions" in the command window
Can anyone explain how this needs to be done or share a link where k-fold is done on a dataset and then passed to a neural network for training?
0 Comments
Accepted Answer
Greg Heath
on 30 Apr 2015
I just wrote a tutorial in the NEWSGROUP
Hope this helps.
Thank you for formally accepting my answer
Greg
More Answers (1)
Greg Heath
on 27 Apr 2015
You probably just need to transpose your input and target matrices. However, to check previous posts consider
ANSWERS Hits
greg neural crossvalidation 36
greg neural cross-validation 61
greg neural cross validation 67
NEWSGROUP Hits
greg neural crossvalidation 32
greg neural cross-validation 55
greg neural cross validation 72
Additional references can be obtained by removing one or both of the leading search words
Hope this helps.
Greg
2 Comments
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!