1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| clear all;
clc
p=load('pima1.txt');
p=p';
t=[ones(1,250) -1*ones(1,250)];
[trainP,valP,testP,trainInd,valInd,testInd] = dividerand(p)% c'est la fonction de division par defaut.
[trainT,valT,testT] = divideind(t,trainInd,valInd,testInd)
nets=newff(minmax(p),[3,1],{'logsig','purelin'},'trainlm');
nets.performFcn = 'mse';
nets.performParam.ratio = 0.5;
nets.trainParam.show = 5;
nets.trainParam.showWindow = 1;
nets.trainParam.epochs = 300;
nets.trainParam.goal = 1e-5;
[nets,tr,Y,E]=train(nets,p,t) |
Partager