Linear Regression vs Logistic Regression
The names make people think both guess numbers. Only one does. Linear regression gives a number on a scale, like a rent. Logistic regression gives a chance between 0 and 1 and is used for yes or no questions. So logistic regression is a classifier, despite its name.
Linear Regression
Guessing a number with a straight line. The line is the one that best fits the data.
Linear regression is a method that guesses a number by drawing the straight line that best fits the data. Each feature gets a weight that says how much it pushes the answer up or down. Training finds the weights that make the line miss the dots by the least. It is simple, fast and easy to explain. It works best when the real link is close to a straight line.
Logistic Regression
It gives the chance that something is true. Then it turns that into yes or no.
Logistic regression is a method that guesses the chance that something is true, such as the chance an email is spam. It adds up the features with weights, like linear regression does. Then it bends that sum into an S-shaped curve that always stays between 0 and 1. A cut-off, often 0.5, turns the chance into a yes or a no. Despite its name, it is used for classification.
In one line
- Linear Regression
- Guessing a number with a straight line. The line is the one that best fits the data.
- Logistic Regression
- It gives the chance that something is true. Then it turns that into yes or no.