Skip to content
Machine Learning

Is logistic regression a linear model? Why?

Logistic regression is considered a generalized linear model because the outcome always depends on the sum of the inputs and parameters.

Proposed by @Al_Grigor

datasciencetrivia.com

Card 1 of 276. Answer: Logistic regression is considered a generalized linear model because the outcome always depends on the sum of the inputs and parameters.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

Yes. Logistic regression is a linear model because it computes a linear combination of the inputs, w·x + b, and the decision boundary where the predicted probability equals 0.5 is the hyperplane w·x + b = 0. It belongs to the family of generalized linear models.

The sigmoid on top is what confuses people. It squashes the linear score into a probability between 0 and 1, so the output is a non-linear function of x, but the log-odds, log(p / (1 − p)), is exactly linear in x. That is the sense in which the model is linear: in the parameters and in the log-odds, not in the probability.

The practical consequence is that logistic regression can only separate classes with a straight line or flat hyperplane. To fit curved boundaries you add features yourself, such as polynomial terms or interactions, or switch to a non-linear model like a tree ensemble or a neural network.

All questions