Lesson 4.3 · 10 min read · about 55 min to master at a very slow pace

The Logistic Regression Model

The model as a linear score passed through a sigmoid, or as linear regression on the log-odds. Interpreting coefficients as odds ratios, computing predictions by hand, and the linear decision boundary.

Not startedJump to quiz

Two equivalent views

The model

View 1 squashes a linear score into a probability. View 2 is a linear model of the log-odds.

Interpreting coefficients

Interpretation

is the change in log-odds of for a one-unit increase in , holding the other predictors fixed. Equivalently, is the factor by which the odds are multiplied: the odds ratio.

  • : higher raises the probability of .
  • : higher lowers it. : odds ratio 1, no effect.
  • The effect on the probability is not constant: it depends on where you start (biggest near , tiny near 0 or 1).

Worked example: customer churn

log-odds , where = number of complaints and = years as a customer.

Odds ratios: and . Each extra complaint multiplies the odds of churning by about 2.2, holding tenure fixed. Each extra year multiplies them by 0.61, a 39% reduction.

Prediction for 3 complaints, 2 years: , so . At threshold 0.5 we predict "no churn".

Probability isn't additive: going to 4 complaints moves from to and from 0.354 to 0.550 (+0.196). The odds rose by the same factor, 2.23, but the probability change depends on the starting point.

What does a predicted 0.85 mean?

A predicted means: among cases like this one, the model estimates that 85% belong to class 1. It's a probability of class membership, not an 85% "amount" of anything. A patient with for diabetes isn't "85% diabetic"; the model gives an 85% chance that they are diabetic.

The decision boundary is linear

With the default rule "predict 1 if ", and since , the boundary is where the linear score is zero:

That's a straight line in 2-D, so logistic regression is a linear classifier even though its probability curve is S-shaped. For the churn model the boundary is . Changing the threshold to shifts the line parallel to itself (to ); it doesn't change the model.

Three common errors

  1. "A one-unit increase raises the probability by ." No: it adds to the log-odds.
  2. Treating an odds ratio of 2 as "twice as likely". It means twice the odds; the probability ratio is smaller unless is small.
  3. Reading coefficients causally from observational data, or comparing magnitudes across predictors with different units.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passWhat does a predicted probability of 0.85 actually mean? Is it 85% of something?

It's the model's estimated probability that this case belongs to class 1. Among many cases with the same predictor values, it expects about 85% to be positive. It isn't a measurement like "85% progressed" or "85% severity". The output is about class membership; the class itself is still yes or no.

Cheatsheet

Logistic coefficient

: change in log-odds per unit . : odds ratio (multiplies the odds). Not a constant change in probability.

Decision boundary

Predict 1 if (0 when ). Linear.

Odds ratio 2 ≠ "twice as likely"

It doubles the odds. The probability ratio is smaller unless is small.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1calculateA model has log-odds . What is at (use )?
Q2interpretIn that model, . How do you interpret it?
Q3conceptIf , what does a one-unit increase in do?
Q4interpretTwo customers have churn probabilities 0.10 and 0.50. Each makes one more complaint, which has an odds ratio of 2.23. What happens?
Q5conceptWhere is logistic regression's decision boundary at threshold 0.5?