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!