# Why lasso yield a higher mse then ridge?

I do a rige and lasso regression on a train data set and get the lambdas via cross validation and evalute the prediction accuracy on a test data set.

After that i do the same procedure for the same data but adding polynomials to the power of 4 and interactions to the order of 2 (V1*V2)+(V1*V3) to the train and test data set.

At the end i get a smaller test mse with ridge for the model with interactions and polynomials compared to the model without interactions. That's a result that i would expect.

But for lasso I have a higher test mse compared to the model without interactions and polynomials. That's what i don't expected.

I don't understand why lasso performs worse than ridge and worse than a model with less explanatory variables?

• Please don't open a new question. Instead, edit the existing one. Commented Jul 16, 2018 at 15:54
• @StephanKolassa its a different question. The first one is about ols compared to ridge and lasso. This one is ridge compared to lasso and . And i also use different data setup Commented Jul 16, 2018 at 15:56
• Thank you for clarifying. However, given that the two questions are very closely related, please include links next time. Commented Jul 16, 2018 at 15:58
• This sounds like an implementation issue. Are you using Elastic Net?
– ERT
Commented Jul 16, 2018 at 16:17
• no i just used ridge and lasso Commented Jul 16, 2018 at 16:32

As Frank Harrell notes in an answer to another question, ridge generally performs better than LASSO in predictions. The main exception is if there really are only a handful of true predictors. In the real world with often correlated predictors, that frequently is not the case.

Your use of interactions and polynomials probably made this problem worse. Typical LASSO formulations do not try to keep main effects and their related interaction terms together in models, so it's possible to develop models that include interaction terms without the associated main effects. That's often not a good idea.

If you also have polynomial modeling of the predictors involved in the interaction terms, then you are starting with a very large set of potential predictors. Ridge regression will include all of those predictors with appropriate penalization of the associated coefficients. LASSO, by its nature, will just choose a few in a way that might not be repeated from sample to sample.

Repeating LASSO selection of predictors on multiple bootstrap samples of your original data can be instructive. You may find wildly different sets of predictors chosen by LASSO among such samples. Ridge regression will keep all of the predictors, and you may be surprised to find how well the values of the penalized coefficients agree among such samples.

• Why is having interaction terms with no main effect "often not a good idea" in the context of predictive models? Commented Jul 16, 2018 at 18:03
• @MatthewDrury this is certainly more of an issue for inference than for prediction. Harrell's experience leads him to recommend keeping lower order effects in models when there are interactions. There are issues with lack of invariance to location shifts in continuous predictors and with coding of categorical predictors; see answers and links on this page. These problems will be exacerbated by including two 2-way interactions among predictors modeled as 4th-order polynomials, as in this question.
– EdM
Commented Jul 16, 2018 at 18:36
• but i have interaction polynomials and the main effects . All is included Commented Jul 17, 2018 at 7:31