Despite the name, logistic regression is a classification model. It predicts the probability of a class, then thresholds it into a label — the standard interpretable baseline for classification.
Fit & predict
from sklearn.linear_model import LogisticRegressionmodel = LogisticRegression(max_iter=1000)model.fit(X_train, y_train)model.predict(X_test) # class labels (0/1)model.predict_proba(X_test) # probability of each class
Probabilities & threshold
Key takeaways
- 01Logistic regression is a classification model — it predicts class probabilities.
- 02predict gives labels; predict_proba gives probabilities.
- 03The default 0.5 threshold can be tuned to trade precision vs recall.
- 04It's fast, interpretable and needs scaled features — the standard classification baseline.
