plotregression fitlm rsquare difference
Show older comments
Hello
Could you help explain why there is a difference between r-squared calculated using plotregression() and fitlm()?
R-squared: 0.968 from fitlm() R = 0.98364 from plotregression()
The code to produce the two r-squared values is below.
%% set up variable from neural network output = net(input); outputTest = output(tr.testInd); targetTest = target(tr.testInd);
%% first method to produce r-squared plotregression(targetTest,outputTest,'Testing')
%% second method to produce r-squared mdl = fitlm(targetTest,outputTest); r2 = mdl.Rsquared.Ordinary;
Regards
William Bell
Accepted Answer
More Answers (0)
Categories
Find more on Pattern Recognition 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!