Simple Linear Regression is basically trying to draw a line that best fit the data.
An example below: Salary based on years of experience
The best fit line is the line which has the minimum sum of squared errors (ordinary least squared).
Similar to Simple Linear Regression but with multiple independent variables.
When we have a use case where our dependent variable is an boolean action (Y/N), applying linear regression is not a good approach. Instead of predicting exactly if the person will do the action or not, we predict the probability or likelihood of that person will take that action.
The probability is from 0 to 1. In this graph, we can see clearly the middle part between the 2 straight line of 0 and 1. That part has an increasing probability as it moves to the right, or the age is increasing. Which means the older they are, the higher the probability this person will likely to take an action.
Mathematically speaking, if we apply the sigmoid function on top of the linear regression, we will get the logistic regression. Similar to linear regression, logistic regression will find the best fitting line that can fit the dataset.
Logistic regression is used to predict the probability $\hat p$. Let's do an example:
How to get predicted value from probability?
Depends on your use case, you can choose your own threshold.