applying k-fold with Artificial Neural Network
이전 댓글 표시
I am trying to employ k-fold with my neural networks. I have a 13 features from 1000 images. (13 *1000 ) dataset , I am trying to see whether 5-fold would agree to the ANN to give better results. I have the body of ANN as next inputs = Z1; targets = c; hiddenLayerSize =60; net = feedforwardnet(hiddenLayerSize); % Train the Network [net,tr] = train(net,inputs,targets); y = net(inputs); perf = perform(net,targets,y);
%%%%%%%%%%%%% %%%%%%% for testing from the same data which trained%%%%%%% testZ1 = inputs(:,tr.testInd); testC = targets(:,tr.testInd); testY = net(testZ1); testYclasses = testY > 0.5; %% to get 0 or 1
[k,cm] = confusion(testC,testY); %you to understand correctly
outputs = net(inputs); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs);
Z2; q = net(Z2); g; q) testqClasses = q > 0.5 ; [w,wm] = confusion(g,q) ;
fprintf('Percentage Correct train Classification : %f%%\n', 100*(1-a)) fprintf('Percentage Incorrect train Classification : %f%%\n', 100*a)
fprintf('Percentage Correct test Classification : %f%%\n', 100*(1-w)) fprintf('Percentage Incorrect test Classification : %f%%\n', 100*w)
How can i implement 5 k fold on the ANN code. Thank for helping
댓글 수: 1
Greg Heath
2015년 10월 4일
편집: Greg Heath
2015년 10월 4일
The fastest way to get help is to
1. use the classification/pattern-recognition function
help patternnet
doc patternnet
2. Apply your code to one or more of of the MATLAB classification/pattern-recognition datasets
help nndatasets
doc nndatasets
Greg
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!