Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

'Index must be a positive integer less than or equal to the number of test sets.'

1 vue (au cours des 30 derniers jours)
Joana
Joana le 11 Déc 2019
Clôturé : Stephen23 le 11 Déc 2019
Hi
i'm trying to create 10-fold cross validation for my CNN. To creat the 10 batches i'm using for loop, but it's giving this error again and again.
'Index must be a positive integer less than or equal to the number of test sets.'
Possibly how i can change the loop to initilize batches.?
selectBatch=cell(1,10);
for k=1:10
%%Prep Data
% 10 kfold crossvalidation indicies
c = cvpartition(204,'kfold',10);
testInd = test(c,selectBatch(k));
trainInd = ~testInd;
epochsTarget = zeros(204,1);
epochsTarget(103:end)=1;
epochsTarget= categorical(epochsTarget);
...............
end

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by