Demo entry 6735829

mm

   

Submitted by anonymous on Apr 25, 2018 at 21:42
Language: Matlab. Code size: 1.1 kB.

raw = xlsread('Fuzzy2018 case study data.xlsx');
shuffled_raw =  raw(randperm(size(raw,1)),:);
shuffled_raw = shuffled_raw';
inputs = shuffled_raw(1:7,1:80);
targets = shuffled_raw(8:8,1:80);
val_inputs = shuffled_raw(1:7,81:98);
val_targets = shuffled_raw(8:8,81:98);
hiddenLayerSize = 3;
net = fitnet(hiddenLayerSize);
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 0/100;
[net,tr] = train(net,val_inputs,val_targets);

% Test the Network
outputs = net(inputs);
errors = gsubtract(outputs,targets);
performance = perform(net,targets,outputs)

% View the Network
%view(net)

% Plots
% Uncomment these lines to enable various plots.
%figure, plotperform(tr)
% figure, plottrainstate(tr)
% figure, plotfit(targets,outputs)
% figure, plotregression(targets,outputs)
% figure, ploterrhist(errors)




% pred=sim(net,val_input);
% figure(1)
% plot(pred,'og')
% hold on
% plot (val_output,'*')
% legend('predict','expect')
% error = mean(abs(pred - val_output));
% error_rate = error/mean(val_output);

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).