Skip to main content

What is the difference between linear and logistic regression?

Machine learning basics · Beginner 3

Short answer

Linear regression predicts a number, such as a house price, by fitting a weighted sum of the features with squared error loss. Logistic regression predicts the probability of a class, such as spam or not, by passing that weighted sum through a sigmoid and training with log loss; you then pick a threshold to make a decision.

Deeper answer

Despite its name, logistic regression is a classification model. Its weights are interpretable as changes in the log odds, which is why it is still used in credit scoring and medicine where explanations matter.

Both are strong baselines: fast, explainable and hard to beat when relationships are roughly linear. Both benefit from scaling and regularisation. For more than two classes, logistic regression extends to softmax regression.

What a strong answer covers

Answer it out loud in the mock interview about 1 min

Follow-ups to expect

Common mistakes

Learn it

Classification

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.