Neural Networks, K fold in patternnet
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
i got 3x1 matrices that i wanna classify in to two groups using k fold crossvalidation method.
- i have to train a network with the patternnet algorithm
- and apply to the data the k-fold cross validation method,
Indices = crossvalind('Kfold',inputs , 5);
for i=1:5
test = (Indices == i);
train = ~test;
for n = 1:5
net = patternnet(inputs,targets,h); %test train
net.divideFcn = 'dividetrain';
net.trainParam.goal = MSEgoal;
net.trainParam.min_grad = MinGrad;
[net,tr] = train(net,inputs,targets); % test train
bestepoch = tr.best_epoch;
R2(n,h) = 1 - tr.perf(bestepoch)/MSEtrn00;
end
the above code is really wrong can someone correct it? its urgent
3 Kommentare
Greg Heath
am 19 Mai 2013
This code is not even close to being correct.
Take some time to think it through, revise, add clarifying comments and either run on one of the nndatasets or include your data and accompanying error messages.
laplace laplace
am 19 Mai 2013
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!