rng seed and cvpartition
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear Matlab Users,
Why cvpartition keeps choosing same test indices in folds from data, despite rng shuffle (thus different seed values assured) ?
When you run code below twice, you got same value of testInd. Why?
Thank you in advance for you help !
clear;
rng shuffle
parpool(parcluster('local'), 24)
tmp = rng;
seed = tmp.Seed;
nData = 89;
nFolds = 10;
selectedFold = 1;
spmd(3)
tmp = cvpartition(nData, 'KFold', nFold)
x = find(tmp.test(selectedFold)); % extract test indices of fold 1
end
for ii = 1:3
testInd(ii,:) = x{ii};
end
% clear context and
clear x tmp
delete(gcp('nocreate'))
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Speed Up Statistical Computations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!