Mean Square Error(MSE) in Lasso and Ridge Regressions in Python

2.1k Views Asked by At

I am actually coding Ridge and LASSO regressions at the same time for one dataset, and at the end I am trying to plot the graphs of performance as well as the Errors (MSE) for both methods.

For the performance, I used the commands linear_model.ridge.score() and linear_model.lasso.score() importing from sklearn. And when i plot the graph, it seems okay like it remains between 0 and 1, but when i tried to calculate the MSE for both individually, it becomes a large number i.e 798,768 (a complete list) etc But I need the error also in between 0 and 1 so that when i plot it, i may able to compare it with performance....

So my question is:

Is there any method to convert such type of list into the numbers between 0 and 1 without losing information?

1

There are 1 best solutions below

0
On BEST ANSWER

Instead of MSE you can use its "normalized version" - the coefficient of determination R^2 (https://en.m.wikipedia.org/wiki/Coefficient_of_determination) which is guaranteed to be between 0 and 1. See this answer for more details https://stats.stackexchange.com/questions/32596/what-is-the-difference-between-coefficient-of-determination-and-mean-squared.