inputs = arr;% target1 = [1 0 0 0 0 0;0 1 0 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0;0 0 0 0 1 0;0 0 0 0 0 1];
% Create a Pattern Recognition Network hiddenLayerSize =26; net = patternnet(hiddenLayerSize); % Set up Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; % Train the Network [net, tr] = train(net,inputs,target2);
% Test the Network outputs = net(inputs); % errors = gsubtract(target1,outputs); % performance = perform(net,target1,outputs);
tInd = tr.testInd; tstOutputs = net(inputs(:,tInd)); tstPerform = perform(net,target2(:,tInd),tstOutputs);
% View the Network view(net) % %plot train state % figure,plottrainstate(tr); %plot confusion figure, plotconfusion(target2,outputs);
Best Answer