You want to predict yes or no. Spam or not spam. Sick or healthy. Fraud or legit.
That's a classification problem. And despite its confusing name, logistic regression is one of the best tools for it.
It doesn't predict a number. It predicts a probability. Then it uses that probability to make a yes or no decision.
Simple idea. Powerful in practice.
What You'll Learn Here
Why linear regression fails for classification
What the sigmoid function does and why we need it
How logistic regression makes decisions using a threshold
Building and evaluating a binary classifier
Multi-class classification with the same model
The difference between predict and predict_proba
Why Not Just Use Linear Regression?
You might think: house prices were numbers, exam scores were numbers, so just use linear regression and predict 0 or 1.
The problem is linear regression can predict values outside 0 and 1. It might predict 1.8 or -0.3.…