linear regression vs logistic regression

linear regression vs logistic regression is a two important backbone of data science and machine learning regression models most of the model and algorithm are using these regression fundamentals in the background.

What is the regression?

Regression analysis is a form of predictive modeling technique which investigates the relationship between a dependent variable Y and independent variable Xn. In another word, regression shows the changes in the dependent variable y-axis with respect to the independent variable x-axis.


Regression analysis a graphing a line for the set of data points which most fit an overall set of data.

Application of Regression:-

  1. Weather forecast
  2. Trend forecast
  3. Sales and marketing, Relationship between age and income.
  4. Trend and sales estimation.
  5. Analyzing the impact of price changes.
  6. Email spam or not.
  7. Assessment the risk in financial services and insurance domain.
  8. A return of investment: – suppose a company invests some fund to promote some brand so they can use regression to calculate the return based on brand marketing investment.
  9. A company can use regression to find out which department (HR, marketing, Sales, Admin, R&D) are taking more salary on their overall revenue.
  10. Regression analysis is useful for customer survey and feedback form to check the quality of service
  11. A company can use a regression model to predict the future employ salary with respect to their experience.


Linear Regression Vs Logistic Regression


Basic Linear Regression Logistic Regression
Core concept A data point is in the form of a straight line Data point are in not straight line, they vary between to point.
Used with Continuous variables Categorical variable
Output Prediction Values of variable The probability of occurrence of an event
Accuracy and goodness of fit Measured by loss, R Squared, Adjusted R squared etc. Accuracy, Precision, Recall, F1 Score, ROC curve, Confusion matrix, etc.
Pattern A linear regression map to continues X to continues Y Logistic Regression map to continuous X to binary Y.

You can use this to a category like truth/false, yes/no, statement.



linear reg formula Logistic formula
Graph type Linear graph

linear graph

Sigmoid graph

sigmoid graph

Regression line also called best-fit line which shows the relationship between the independent variable and dependent variable.

regression line

Positive Regression line is the line where dependent values at Y-axis is a proposal to an independent value X-axis line of slop is +ve  Y = mx+c

regression line

Negative Regression line where your independent values increasing on X-axis and dependent values on y-axis decreasing so Y values inversely professional to X values where the slope of the regression line is -ve Y = -mx+c

regression line

Logistic regression work as a switch it will be either 0 or 1 logistic regression data not linearly separated instead of that it will be divided into two group.

We can transform the logistic regression formula by putting linear regression y value in a sigmoid function.

linear regression vs logistic regression

3d logistic regression data point


Wrapping up: So Linear regression vs Logistic regression by looking at the data pattern we can easily understand which regression will work well with what kind of datasets. Linea regression work grates with the continuous data point and provide good accuracy which predicting unseen data point. In other hands, logistic regression works very accurately with a group of the data point.

You May Also Like

3 thoughts on “linear regression vs logistic regression

  1. Nice post. I was checking constantly this blog and I’m inspired!
    Extremely useful information specifically the last phase 🙂 I maintain such info much.
    I used to be seeking this particular information for a very lengthy time.
    Thanks and good luck.

Leave a Reply

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