Home/Machine Learning/Logistic Regression
Machine Learning

Logistic Regression

Linear regression's classifier cousin — bends a straight line into a probability between 0 and 1, and remains the default first model for "yes or no" questions.

Reviewed July 16, 2026Stable
Reading level: Curious
Pick your depth ↓

When not to use it

  • When classes aren't linearly separable and feature engineering can't fix it — the linear boundary will underperform.
  • When you need to model complex feature interactions automatically — tree models or networks handle those without manual work.
  • When raw calibrated probabilities matter and the model is uncalibrated — the 0–1 output can be over- or under-confident.

Reach for something else instead

  • Linear regression when the target is a number, not a category.
  • Gradient boosting / random forests for higher accuracy on tabular classification with interactions.
  • Naive Bayes as an even simpler probabilistic classifier, especially for text.

Logistic regression bends a line into an S-shaped probability.

p = 0.5 (decision) class 0class 1

Instead of a straight line, logistic regression fits the S-shaped sigmoid, which maps any input to a probability between 0 and 1. Points far on one side approach 'definitely yes,' far on the other 'definitely no,' and the steep middle is where the model is uncertain. The 0.5 crossing is the decision boundary.

Sources & further reading

  • Cox (1958), The Regression Analysis of Binary Sequences — foundational treatment of logistic regression.
  • Hastie, Tibshirani & Friedman, The Elements of Statistical Learning — logistic regression within the generalized-linear-model framework.
  • James et al., An Introduction to Statistical Learning — the accessible classification chapter.

Primary sources, listed so you can check the claims on this page rather than take them on trust.

Where people go wrong

  • Expecting it to handle non-linear class boundaries without feature transforms.
  • Reading its 0–1 output as a calibrated probability when it hasn't been checked for calibration.
  • Confusing it with linear regression because of the name — it classifies.

At a glance

FieldMachine Learning
Predictsprobability of a class (0–1)
Squashingthe sigmoid
Trained bymaximum likelihood (cross-entropy)
DifficultyBeginner
Flashcards for this concept · study, save or share them →
Question
Answer
1 / 4