k fold with all combinations

1 回表示 (過去 30 日間)
DIMITRIOS THEODOROPOULOS
DIMITRIOS THEODOROPOULOS 2019 年 4 月 28 日
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 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by