k-fold for nprtool

1 回表示 (過去 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 Center および File ExchangeDetection, 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