ML | Mathematical explanation of RMSE and R-squared error
RMSE: Root Mean Square Error is the measure of how well a regression line fits the data points. RMSE can also be construed as Standard Deviation in the residuals.
Consider the given data points: (1, 1), (2, 2), (2, 3), (3, 6).
Lets break the above data points into 1-d lists.
x = [1, 2, 2, 3] y = [1, 2, 3, 6]
Code : Regression Graph
Code: Mean Calculation
Value of X mean 2.0 value of Y mean 3.0
Code : Line Equation
Code : Mean Squared Error
Root mean square error 0.6123724356957945
Code : RMSE Calculation
Root Mean square error using maths 0.6123724356957945
R-squared Error or Coefficient of Determination
R2 error answers the below question.
How much y varies with variation in x.Basically the % variation of y on variation with x
Code : R-Squared Error
Rsquared error 0.8928571428571429
Code : R-Squared Error with sklearn
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.