Why does my R-square value 1 on Regression Learner App?
2 views (last 30 days)
Show older comments
My predicted values are not perfect, but R-square value is 1. Why? Thank you...
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/304503/image.png)
0 Comments
Answers (1)
Raunak Gupta
on 31 May 2020
Edited: Raunak Gupta
on 31 May 2020
Hi,
After understanding the response plot, I can say that the RMSE(root mean squared error) in the calculation is two order of magnitude i.e. more than 100 times smaller than the actual regression values. According to the documentation of Coefficient of Determination, the value is calculated as
errorRatio = (sum of squared error for all data points /sum of square of actual regression value);
rSquareValue = 1 - errorRatio;
So, the above errorRatio is less than 0.005 as per calculated by model thus making the R-squared value 1.00 due to only viewing in 2 decimal places. Though the model will not perfectly calculated regression output but the R-squared value is close to 1 because of very small sum of square of error.
Hope this clarifies the doubt.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!