When we have to predict the value of a categorical (or discrete) outcome we use logistic regression. I believe we use linear regression to also predict the value of an outcome given the input values.

Then, what is the difference between the two methodologies?

Feb 2, 2022 338 views

## 1 answer to this question.

Linear Regression and Logistic Regression are both Supervised Machine Learning Algorithms.
The basic difference between the Logistic and Linear Regression are :

1) Prediction
Linear Regression is used for making predictions when the outcome is continuous in nature.
Eg. Predicting price of the house based on several features.
Logistic regression is used for making predictions when the outcome is nominal or categorical in nature.

Eg. Predicting whether a person has diabetes or not thus classifying into Yes for having diabetes and No for not having diabetes.

2) Assumptions

Linear regression assumes a linear relation between an independent variable and dependent variable.Linear Regression is also sensitive to outliers.

Logistic regression on the other hand does not require a linear relationship between dependent and independent variables.
Because the outliers are tapered by the sigmoid function, outliers have little impact on logistic regression models. However, the presence of severe outliers may have an impact on the model's performance, decreasing it.

3) Equation
Linear regression equation is given simply by:

Y = mX + C,

Logistic regression equation is given by:

Y = eX + e-X

4) Way of reducing errors is different
Linear regression uses ordinary least squares to minimize error and find the best fit for the model.

Logistic regression uses a maximum likelihood method to minimize the errors.

Hope this helps.
• 5,480 points

## What is the difference between regression testing and mutation testing?

Regression testing is a test suite that ...READ MORE

## Can someone explain to me the difference between a cost function and the gradient descent equation in logistic regression?

when we train a model with data, ...READ MORE

## What is the difference between supervised learning and unsupervised learning?

Supervised and unsupervised learning are two types ...READ MORE

## What is the difference between Deep Learning and traditional Artificial Neural Network machine learning?

A large number of layers causes serious ...READ MORE

## Python code for basic linear regression

Hi @Dipti, you could try something like ...READ MORE

## Show python implementation of Lasso class - regression

Hey @Tanmay, try something like this: >>> from ...READ MORE

## What is LassoLars? - Linear regression

LassoLars is a lasso model implemented using ...READ MORE

## Can you give LassoLars python example?

Hey @Vivek, Try something like this: >>> from ...READ MORE