필터 지우기
필터 지우기

k-fold for nprtool

조회 수: 2 (최근 30일)
yogini prabhu
yogini prabhu 2022년 6월 22일
댓글: yogini prabhu 2022년 6월 29일
Apart from creating a NN and generating plots like confusion matrix ; how can one induce the k-fold CV method into the inputs data matrix for the NN;
specifically, for a 4-class classificaction problem with 10 samples inputs in each .
  댓글 수: 1
yogini prabhu
yogini prabhu 2022년 6월 29일
This does the job:-
cvFolds1 = crossvalind('Kfold',10, k); cvFolds2 = crossvalind('Kfold',10, k); cvFolds3 = crossvalind('Kfold',10, k); cvFolds4 = crossvalind('Kfold',10, k);
cvFolds=[cvFolds1;cvFolds2;cvFolds3;cvFolds4];
for i = 1:k
net = configure(net,input,target);
testIdx = (cvFolds == i);
trainIdx = ~testIdx;
trInd = find(trainIdx)
tstInd = find(testIdx)
net.trainParam.epochs = 100;
net.divideParam.trainInd = trInd
net.divideParam.testInd = tstInd

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Detection, Range and Doppler Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by