Repartition data for cross-validation
cnew = repartition(
defines a random partition of the same type as
c is also a
cvpartition object. That is,
repartition takes the same observations in
repartitions them into new training and test sets.
Repartition Data for Cross-Validation
Repartition observations in a
cvpartition object. The type of validation partition remains the same.
Partition 100 observations for 3-fold cross-validation.
c = cvpartition(100,'KFold',3)
c = K-fold cross validation partition NumObservations: 100 NumTestSets: 3 TrainSize: 67 66 67 TestSize: 33 34 33
Repartition the observations.
cnew = repartition(c)
cnew = K-fold cross validation partition NumObservations: 100 NumTestSets: 3 TrainSize: 67 66 67 TestSize: 33 34 33
Notice that the set of observations in the first test set (fold) of
c is not the same as the set of observations in the first test set of
ans = logical 0
View the validation partition type of
cnew are validation partitions of the same type,
ans = logical 1
ans = 'kfold'
c — Validation partition
Validation partition, specified as a
cvpartition object. The validation partition type of
c., is the same as the validation partition type of the new
s — Random number generator
Random number generator for the new partition, specified as a
Repartitioning is useful for Monte Carlo repetitions of cross-validation analyses.
repartitionwhen you specify the
'MCReps'name-value pair argument.
Introduced in R2008a