I have fitted Lasso and Ridge regressions on the same training data and having checked the training MSE error seems more-less the same:
from sklearn.linear_model import Ridge, Lasso
from sklearn.metrics import mean_squared_error
lasso = Lasso()
lasso.fit(X_train, y_train)
print(lasso.coef_, lasso.intercept_)
print(mean_squared_error(y_train, lasso.predict(X_train)))
Gives:
[-0., 0., -0., 0.07240139, -0., 2.78814019, -0., -0., -0., -0., -1.2595198, 0.13041602, -3.58735814] 22.862623762376256
28.099545911959265
And:
ridge = Ridge()
ridge.fit(X_train, y_train)
print(ridge.coef_, ridge.intercept_)
print(mean_squared_error(y_train, ridge.predict(X_train)))
Gives:
[-0.74031532, 1.19138487, 0.09161603, 0.7471897, -1.81315326, 2.62583585, -0.04210494, -2.95522009, 2.79949698, -1.97974729, -2.02004127, 0.87593085, -3.89141515] 22.86262376237627
21.691959974765535
I expected the coefficients of the respective models to somewhat correlate (with the cancellation of very small Ridge coefficients to be zero in Lasso) but this is apparently not the case. What could be the explanation?