views:

453

answers:

3

Upon some research I found two functions in MATLAB to do the task:

  • cvpartition function in the Statistics Toolbox
  • crossvalind function in the Bioinformatics Toolbox

Now I've used the cvpartition to create n-fold cross validation subsets before, along with the Dataset/Nominal classes from the Statistics toolbox. So I'm just wondering what are the differences between the two and the pros/cons of each?

A: 

It might be a good idea to post your question on Matlab Central

Chris Arnold
+1  A: 

They look to be pretty similar based on the official docs of cvpartition and crossvalind, but crossvalind looks slightly more flexible (it allows for leave M out for arbitrary M, whereas cvpartition only allows for leave 1 out).

Mr Fooz
+2  A: 

They look to be pretty similar based on the official docs of cvpartition and crossvalind, but crossvalind looks slightly more flexible (it allows for leave M out for arbitrary M, whereas cvpartition only allows for leave 1 out).

isnt it true that you can always simulate a leave-M-out using kfold cross validation with an appropriate k value (split data into k fold, test on one, train on all others, and do this for all folds and take average) since leave-one-out is a special case of kfold where k=number of observations.

related questions