Linear regression vs Logistic regression

 Difference between Linear and Logistic regression:

In linear regression the outcome variable has a range i.e continuous in nature, But in logistic regression it has only two values: either 0 or 1. It doesn't entertain the values below 0 or above 1. So, once it is formulated into an equation the curve takes an 'S' shape also called the sigmoid curve .( 'S' curve ).


Linear Regression

Logistic Regression

The outcome is continuous in nature.

The outcome is categorical in nature i.e, it has discrete values

Ex: if it’s raining or raining.

The linear graph is straight line.

The graph is ‘S’ curve

It solves regression problems i.e, you need to predict the value of dependent variable using the value of independent variables.

It basically solves classification problems, it tells whether an event is happening or not.

 Applications :

weather predictions: Both Linear and Logistic used for weather predictions. 

  • Linear---> will tell you what's the temperature of tomorrow
  • Logistic--> will tell you if it rains tomorrow or not.
Classification problem: 
  • identifying a particular animal, 
  • determination of illness  and so..on.

Pros and cons of Logistic regression:

  •  Easy to implement, doesn't require high computation power and it doesn't require scaling of features.
  • Not able to handle a large number of categorical variables, can't solve non-linear problems.


Comments