-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
Hello,
I was using cvpartition when I saw that cvpartition in Octave using KFold = 10 is giving groups of random sizes while with matlab the result was groups of same size or almost the same size when the number of observations is not divisible by the number of partitions.
The code I tried:
rng (1); % for reproducibility
y = randi (30,1,50);
cpart = cvpartition (y, 'KFold', 10);Stratified k-fold cross validation partition
NumObservations: 50
NumTestSets: 10
TrainSize: [26 48 48 45 50 42 45 48 48 50]
TestSize: [24 2 2 5 0 8 5 2 2 0]
IsCustom: 0
IsGrouped: 0
IsStratified: 1
TrainSize and TestSize have arbitrary number of observations. Doing the same with matlab retrieves the following:
K-fold cross validation partition
NumObservations: 50
NumTestSets: 10
TrainSize: 45 45 45 45 45 45 45 45 45 45
TestSize: 5 5 5 5 5 5 5 5 5 5
IsCustom: 0
I copied the y variable literally in matlab
The number of observations of TrainSize and TestSize is the same for each group.
Metadata
Metadata
Assignees
Labels
No labels