k fold with all combinations
1 次查看(过去 30 天)
显示 更早的评论
I want to create K fold tests.
Concretely, i want to split my data set in 10 folders.I want to use every time 7 for training and the others 3 for test.But i dont want only once but i wanto to use all the possible combination.So every splitted set can be used 7 times for training and 3 for testing,total 10 times..
I havr e the follwong code(i attach the file)
[meas,species,~]=xlsread('C:\Users\User\Desktop\BeePollenMachineLearning\FINAL\DOCUMENTS\Features_Species2.xlsx');
X = meas;
Y = categorical(species);
classOrder = unique(Y);
rng(1); % For reproducibility
t = templateSVM('Standardize',1);
CVMdl = fitcecoc(X,Y,'CrossVal','on','Learners',t,'ClassNames',classOrder);
labels = kfoldPredict(CVMdl);
idx = randsample(numel(labels),20);
table(Y(idx),labels(idx),...
'VariableNames',{'TrueLabels','PredictedLabels'})
BUt it creates a random test of 10 testing cases which are always the same although randomsample.
How can i see all the possible combinations of the folders?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!