Using lasso regression
A key characteristic of OLS is that it produces the parameter estimates with the least bias. However, OLS estimates may have a higher variance than we want. We need to be careful about overfitting when we use a classical linear regression model. One strategy to reduce the likelihood of overfitting is to use regularization. Regularization may also allow us to combine feature selection and model training. This may matter for datasets with a large number of features or observations.
Whereas OLS minimizes mean squared error, regularization techniques seek both minimal error and a reduced number of features. Lasso regression, which we explore in this section, uses L1 regularization, which penalizes the absolute value of the coefficients. Ridge regression is similar. It uses L2 regularization, which penalizes the squared values of the coefficients. Elastic net regression uses both L1 and L2 regularization.
Once again, we will work with the gasoline tax data from...