applying k-fold with Artificial Neural Network
1 次查看(过去 30 天)
显示 更早的评论
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
采纳的回答
Greg Heath
2015-10-4
编辑:Greg Heath
2015-10-4
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
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Pattern Recognition and Classification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!