cross validation in neural network using K-fold

조회 수: 6 (최근 30일)
Mustafa Al-Nasser
Mustafa Al-Nasser 2019년 7월 17일
댓글: Mustafa Al-Nasser 2019년 7월 18일
Dear All;
i am using neural network for classification but i need to use instead of holdout option , K-fold.
i use cvparatition command to do that , which parameter of neural network shall i change to enable K-Fold option
the code
c = cvpartition(length(input1),'KFold',10)
net=patternnet(100)
net=train(net,input',Target_main')

답변 (1개)

Greg Heath
Greg Heath 2019년 7월 18일
%i am using neural network for classification but i need to use instead of
holdout option , K-fold.
==> FALSE!. You mean you WANT to use K-fold.
% i use cvparatition command to do that , which parameter of neural
network shall i change to enable K-Fold option the code
%c = cvpartition(length(input1),'KFold',10)
% net=patternnet(100)
==> WRONG! numH = 100 is ridiculously large.
There is no excuse for this. There are numerous examples in both the
NEWSGROUP and ANSWERS on how to choose a reasonable value
for numH.
Greg
  댓글 수: 1
Mustafa Al-Nasser
Mustafa Al-Nasser 2019년 7월 18일
Dear Greg;
i am takling about K-fold cross valdation technique for neural network
the defualt option is holdout one which hold certain perecantge for testing and valdiation
in my example, i need to use this technuque in my code
my problem is how to run code for 10 folds, shall repeat the excuation 10 time using for loop and take the average of 10 runs
for number of neourons , i know this big but the data set large, this was just trail , forget about it
i wrote the below code which can do 1 fold only, so, how can we run it for all fold and take the avergae
c = cvpartition(length(input1),'KFold',10)
trainData =input(training(c),:);
testData = input(test(c),:);
net=patternnet(50)
net=train(net,trainData,Target_main)

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

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by