K-Fold Cross Validation with & without Random Shuffle Data
This function creates two cell arrays, one with training data and the other with testing data. The testing sample size is determined by the number of samples divided by the desired K values. If the terms are not divisible, the function will truncate the least number of points to perfectly divide the sample size by K. You have the option to choose if the testing and training sets samples are chosen at random by turning shuffle 'on' or 'off'.
The input data must be in column vectors/matrices, if the function believes you have entered a row vector/matrices it will automatically transpose the data. Check the functions help section for more details.
Cites:
https://en.wikipedia.org/wiki/Cross-validation_(statistics)
Cite As
Edgar Manriquez-Sandoval (2024). K-Fold Cross Validation with & without Random Shuffle Data (https://www.mathworks.com/matlabcentral/fileexchange/68274-k-fold-cross-validation-with-without-random-shuffle-data), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |