applying k-fold with Artificial Neural Network

1 vue (au cours des 30 derniers jours)
fathi
fathi le 2 Oct 2015
Modifié(e) : Greg Heath le 4 Oct 2015
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 commentaire
Greg Heath
Greg Heath le 4 Oct 2015
Modifié(e) : Greg Heath le 4 Oct 2015
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

Connectez-vous pour commenter.

Réponse acceptée

Greg Heath
Greg Heath le 4 Oct 2015
Modifié(e) : Greg Heath le 4 Oct 2015
Search BOTH the NEWSGROUP and ANSWERS using
greg cross validation
greg crossvalidation
greg cross-validation
Check the newest posts first.
Hope this helps.
Greg
PS Also try adding the term TUTORIAL

Plus de réponses (0)

Catégories

En savoir plus sur Pattern Recognition and Classification dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by