MATLAB Answers

Neural Network - R value equal 1- Over fitting

22 views (last 30 days)
Mustafa Al-Nasser
Mustafa Al-Nasser on 5 Aug 2019
Answered: Srivardhan Gadila on 12 Aug 2019
Dear All;
I built a neural network model for regression as shown below but i i got R value equal 0.99998 which alomost 1 , does this indicate that i have overfitting ? if yes , how can i resolve it?
% Read input and output vaules
data=readtable ('GOSP_DATA_Final.xlsx','sheet','Data');
I1=data.Ta;
I2=data.LPPT_P;
I=[I1 I2];
I=I';
T=data.LR;
T=T';
% Normalization between -1 and 1
[I,ps] = mapminmax(I);
[T,ts] = mapminmax(T);
% Building Network
h= 10;
net= fitnet(h);
[net,tr] = train(net, I, T);
% Teting Neural networl
tInd= tr.testInd;
tstOutput=net(I(:,tInd));
tstOutput = mapminmax('reverse',tstOutput,ts);
T(tInd)= mapminmax('reverse',T(tInd),ts);
tstperformance = perform(net, T(tInd), tstOutput)
figure (1),
plotregression(T(tInd),tstOutput);

  0 Comments

Sign in to comment.

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 12 Aug 2019
If the calculated R value is almost same for all the three Train, Test and Validation sets then your model is no near to Overfitting. If you observe that the calculated R for training set is more than that for validation and test sets then your network is Over fitting on the training set. You can refer to Improve Shallow Neural Network Generalization and Avoid Overfitting.

  0 Comments

Sign in to comment.


Translated by