How to do Linear, LASSO, Ridge and ElasticNet Regression in sklearn

This tutorial demonstrates how to do 4 types of regression in sklearn – Linear, LASSO, ridge and ElasticNet.

LASSO, ridge and ElasticNet regression are regularized forms of regression that aim to constraint the model by reducing the model coefficients (aka weights). The purpose is to reduce the variance in the model. Due to the bias-variance tradeoff, this inevitably leads to a higher bias (and hence, higher RMSE and lower R2 scores).

Nonetheless, regularization should help to reduce overfitting.

Link to Code (as HTML file)

Regression.html


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *