Link Search Menu Expand Document

Logistic Regression is another statistical model.

Logistic Regression

  • It is similar like Linear Regression. But the Only difference is it is used for Classification Model, whereas Linear Regression is used on Regression Model.
  • Input can be continuous or categorical
  • Outcomes could be class and probabilities
  • It uses logistic function to estimate the prediction.
  • It Can be binomial, ordinal, multinomial.
  • If Target variable contains two classes then it is called binomial, If Target variable contains more than two classes then Multinomial, if it has low medium, high then it is called as ordinal Logistic Regression will accept all three cases.

    Formula for Logistic Regression

    In above formula, Logistic function, will convert the predicted value into probability

Probability ranges from 0 to 1..
If P is 0-0.5 then it belongs to class 0..
0.5 to 1 then it belongs to class 1..

For Linear Regression, it calculates Regression Coefficient for every single variable, For Logistic Regression, it calculates Regression Coefficient for every single category in the every variable

Pre Requisites:

  • When we have Target Variable with “yes”, “no”, then it should be balanced. This balance is important when training the Model.If it is not balanced, example 95% yes, and 5% no, then it is target class imbalance, there is a separate algorithm to deal with this.
  • No Multicollinearity, Data should be free from Multicollinearity
  • No Outliers, Data should be free from outliers
  • Independent Errors, Errors should not be dependent and should not follow any patterns.

Above are some pre requisites for Logistic Regression. With this we will end up and move to Python implementation of Logistic Regression.