Overfitting or what is the problem
Show older comments
I am training my NN getting good results (I think) se attached pictures, but if I test my NN for new datas results are very poor. Here is my code

x = inMatix; %19x105100 two year dataset
t = targetData; %1x105100 hist el.load
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
net=feedforwardnet(20,trainFcn);
%net = fitnet(hiddenLayerSize,trainFcn);
% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivision
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainParam.epochs = 1000;
net.trainParam.lr = 0.001;
net.performFcn = 'mse'; % Mean Squared Error
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression', 'plotfit'};
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
% Recalculate Training, Validation and Test Performance
trainTargets = t .* tr.trainMask{1};
valTargets = t .* tr.valMask{1};
testTargets = t .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,y)
valPerformance = perform(net,valTargets,y)
testPerformance = perform(net,testTargets,y)
10 Comments
Matthew Clark
on 23 Mar 2019
Matthew Clark
on 23 Mar 2019
Greg Heath
on 23 Mar 2019
Edited: Greg Heath
on 24 Mar 2019
You've originally posted a bunch of stuff that looks OK.
How about illustrating EXACTLY what your problem is?
And how about explaining your new unlabeled plot!!!
Greg
Matthew Clark
on 24 Mar 2019
Edited: Matthew Clark
on 24 Mar 2019
Greg Heath
on 24 Mar 2019
You need to begin by considering the auto and crosscorrelation functions.
Then try to reduce the number of inputs.
See some of my previous posts in the NEWSGROP as well as in ANSWERS.
Greg
Matthew Clark
on 25 Mar 2019
Edited: Matthew Clark
on 25 Mar 2019
Greg Heath
on 25 Mar 2019
Correlation plots typically start at delay = 0 , peak at critical delay spacings and decay at large delays
Look for previous narxnet posts (NEWSGROUP & ANSWERS with correlation calculations and/or plots
greg
Matthew Clark
on 26 Mar 2019
Matthew Clark
on 26 Mar 2019
Matthew Clark
on 26 Mar 2019
Answers (0)
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




