Logistic Regression is a machine learning algorithm that is used to predict the probability of a categorical dependent variable.It is a goto method for binary classification problems. In logistic regression the range of hypothesis is between 0 and 1 (0≤h(x)≤1).

The formula for logistic regression is (1/1+exp(-z)). This function is also called as Sigmoid function or Logistic function. It is a S shape curve which goes from 0 to 1. Logistic Regression provide probabilities and classify new samples using continuous and discrete measurements. t produces results in binary format like (0 or 1, Yes or No, True or False, High or Low).

Logistic Regression assumptions:

Binary logistic Regression requires the dependent variable to be binary.

It requires large sample sizes.

The independent variable should have little or no collinearity.

There are 3 types of Logistic Regression:

- Binary Logistic Regression- example: spam or not.
- Multinomial Logistic Regression- example: predicting which food is preferred more(Veg, non-veg,Vegan). It does not have ordering.
- Ordinal Logistic Regression- example: Movie rating from 1–5. It has ordering.

Logistic Regression does not require linear relationship between dependent and independent variables. It can handle various types of relationships because it applies a no linear Log transformation to the predicted odds ratio.

Logit=log(p/1-p).