Difference between linear regression and logistic regression

Linear and logistic regression

  • In linear regression, the outcome (dependent variable) is continuous. It can have any one of an infinite number of possible values.
  • In logistic regression, the outcome (dependent variable) has only a limited number of possible values.
  • Logistic regression is used when the response variable is categorical in nature. For instance, yes/no, true/false, red/green/blue, 1st/2nd/3rd/4th, etc.
  • Linear regression is used when your response variable is continuous. For instance, weight, height, number of hours, etc.
  • Linear regression gives an equation which is of the form Y = mX + C, means equation with degree 1. However, logistic regression gives an equation which is of the form Y = eX + e-X
  • In linear regression, the coefficient interpretation of independent variables are quite
    straightforward (i.e. holding all other variables constant, with a unit increase in this variable, the
  • The dependent variable is expected to increase/decrease by xxx).
  • In logistic regression, depends on the family (binomial, Poisson, etc.) and link (log, logit, inverse-log, etc.) you use, the interpretation is different.
  1. In case of Linear Regression the outcome is continuous while in case of Logistic Regression outcome is discrete (not continuous)
  2. To perform Linear regression we require a linear relationship between the dependent and independent variables. But to perform Logistic regression we do not require a linear relationship between the dependent and independent variables.
  3. Linear Regression is all about fitting a straight line in the data while Logistic Regression is about fitting a curve to the data.
  4. Linear Regression is a regression algorithm for Machine Learning while Logistic Regression is a classification Algorithm for machine learning.
  5. Linear regression assumes gaussian (or normal) distribution of dependent variable. Logistic regression assumes binomial distribution of dependent variable.