Skip to main content
Added `scikit-learn` tag; minor grammar correction
Link

Why does LassoCV mean square error dependsdepend on alphas interval?

Source Link

Why LassoCV mean square error depends on alphas interval?

I am tuning alpha coefficient in Lasso regularisation to get best result on cross-validation:

alphas = np.arange(1,200, 1)
from sklearn.linear_model import LassoCV
lasso=LassoCV(alphas=alphas)
r=lasso.fit(X,y)
plt.plot(alphas,lasso.mse_path_)

This gives me following picture:

enter image description here

I want to see minimum of the red curve,enlarge alpha interval twice (np.arange(1,400, 1)) and rerun the code:

enter image description here

Why curves' coorientations depend on alphas array size??