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.
203 Downloads
Updated 21 Jul 2018

View License

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
Created with R2018a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0