Skip to main content
Albero Academy

Logistic Regression

The go-to baseline for classification — predicting probabilities.

Classification9 min

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

labels and probabilities
from sklearn.linear_model import LogisticRegression
model = 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

  1. 01Logistic regression is a classification model — it predicts class probabilities.
  2. 02predict gives labels; predict_proba gives probabilities.
  3. 03The default 0.5 threshold can be tuned to trade precision vs recall.
  4. 04It's fast, interpretable and needs scaled features — the standard classification baseline.

Finished this chapter?

Mark it complete to track your progress through Scikit-learn.