k fold with all combinations
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!