| Contents | Index |
Repartition data for cross-validation
cnew = repartition(c)
cnew = repartition(c) constructs an object cnew of the cvpartition class defining a random partition of the same type as c, where c is also an object of the cvpartition class.
Repartitioning is useful for Monte-Carlo repetitions of cross-validation analyses. repartition is called by crossval when the 'mcreps' parameter is specified.
Partition and repartition 100 observations for 3-fold cross-validation:
c = cvpartition(100,'kfold',3)
c =
K-fold cross validation partition
N: 100
NumTestSets: 3
TrainSize: 67 66 67
TestSize: 33 34 33
cnew = repartition(c)
cnew =
K-fold cross validation partition
N: 100
NumTestSets: 3
TrainSize: 67 66 67
TestSize: 33 34 33Check for equality of the test data in the first fold:
isequal(test(c,1),test(cnew,1))
ans =
0
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |