How to Choose Different Types of Linear Regression?

Xinqian Zhai
3 min readJun 20, 2022

--

Regression image created by the author

Confused about different types of regression, such as Least-Squares Linear Regression, Ridge Regression, Lasso Regression, and Polynomial Regression? Are you trying to understand the differences between them and how to pick the right one for your scenario at a high level without knowing too much math behind them? If so, this article may help.

What is the relationship between different types of Linear Regression?

Before learning about Ridge Regression, Lasso Regression, or Polynomial Regression, let’s have a quick review of what Linear Regression is. Linear regression is an example of a linear model that predicts output values (y) based on input features (x). The goal is to find the best fitting line for the given data by estimating feature weights (w) and constant bias terms (b).

Simply put, Least Squares, Ridge Regression, Lasso Regression, and Polynomial Regression are different methods for solving linear regression problems. Among them, the Least squares method is the most basic and simple one, and other regression approaches are based on it and add their own power to solve more complex linear problems.

More specifically, both Ridge Regression and Lasso Regression use the same least squares criterion, but add different forms of penalty for large changes in the input features (x); Polynomial Regression also uses the same least square criterion but can generate new features from the original input features(x) to solve a nonlinear problem in a linear space.

Which type of Linear Regression should I use?

Although it’s based on the problem you’re trying to solve, here are some guidelines I use for choosing the type of regression. The first thing to note is that they are all regression models used to predict continuous values, such as predicting house prices. (As a reminder, logistic regression is a classification model in spite of being called “regression”.)

Least Squares Linear Regression is a good choice if your dataset has clear global trends and low variance. Least squares linear regression is a simple and efficient regression model that minimizes the difference between predicted and actual target values without extra effort to tune parameters that control model complexity. It can provide stable but potentially inaccurate predictions.

Ridge Regression or Lasso Regression would be better if your dataset has many input features and you want to prevent overfitting. They both add penalties on input features to narrow down the least influential input features. In other words, use them if you want to restrict model complexity. Use Lasso Regressionif your requirement is to select only the most influential input features; otherwise, use Ridge Regression if your requirement is to weaken the less influential features.

Different types of linear regression plot created by the author

Polynomial Regression is the best candidate if the global trend shows a curved line rather than a straight line. The power of polynomial regression is that it can solve nonlinear problems in linear space that other types of linear regression, such as least squares, ridge, and lasso regression, are difficult to solve. By doing feature transformation, the nonlinear relationship between the input features and the target variable can be better represented by a curve instead of a straight line, which greatly improves the prediction accuracy.

For more details on how polynomial regression solves non-linear problems, check out this article I wrote earlier.

Key takeaways

  • Least-squares linear regression is a simple, effective, but potentially inaccurate approach for predicting continuous values.
  • Ridge regression helps reduce model complexity by adding a penalty to less influential features.
  • Lasso regression helps find the most influential features by shrinking the values of less influential features to zero.
  • Polynomial regression helps solve non-linear regression problems in linear space.
  • Logistic regression is used for binary classification, not regression analysis.

--

--

Xinqian Zhai

Graduate student at the University of Michigan and a new learner on the road to data science.