Created
February 25, 2022 13:29
-
-
Save qdpham/21b30181a8e0dd50cfcbba57b61e9b70 to your computer and use it in GitHub Desktop.
Fun-inria MOOC scikit-learn Exervice M4.04: Different outputs for linear regression coefficients
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Here are the two files reproducing the issue, that we talked about in the forum, about exact same coefficients between
LinearRegression
andRidge
on my machine.The first file
fun_linear_models_ex_04.ipynb
is the code run from the fun-inria server and the secondmy_linear_models_ex_04.ipynb
run from my local machine.Note that I’ve added a cell for computing the coefficients by hand.
I had an error raised from the fun-inria server, as the determinant is computed at exactly 0, however the `LinearRegression’ still provides results without explicit warning (although we can understand that the coefficients are unreasonable).
On the other hand, the determinant is computed at approximately 0 on my machine and so I could proceed and got somewhat reasonable coefficients.
At the end of the day, I get the same coefficients between
LineaarRegression
andRidge
(regularized) on my machine.