What is the primary distinction between linear regression and logistic regression?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's where people flip the names. Linear regression draws a best-fit line or hyperplane to predict a number — price, temperature, demand. Logistic regression squashes a linear score into a probability for classes — spam or not, churn or not. Think of it like a thermostat reading versus a yes/no alarm. Trap on the exam: options that swap classification and regression, or claim linear is unsupervised. Feature count? Not the story. Remember: linear goes to continuous; logistic goes to categories and probabilities. If your boss walks in asking will they buy, you're in logistic territory; how much will they spend is linear. Got it? Let's keep rolling.
Full explanation below image
Full Explanation
Linear regression and logistic regression are both supervised techniques that model a target as a function of input features, but they address different prediction types. Linear regression assumes a continuous real-valued response and typically minimizes squared error between predicted and actual numeric labels. Predictions can fall anywhere on the real line subject to modeling choices, which matches problems such as forecasting revenue, energy load, or sensor readings.
Logistic regression, despite the name regression, is primarily used for classification. It models the log-odds of class membership as a linear function of inputs and applies a logistic sigmoid transform to produce probabilities between zero and one. A decision threshold then yields class labels for binary problems; multinomial extensions handle multiple categories. Thus the main exam-relevant distinction is continuous versus categorical targets—not which method uses more features, and not a claim that linear regression is unsupervised.
Common distractors reverse the tasks by claiming linear classifies while logistic predicts continuous values, or they misfile linear regression under clustering. Both algorithms can share similar feature sets and regularization ideas; the loss function and interpretation of outputs differ. Practitioners also note assumptions such as linearity in parameters for the modeled quantity, residual structure for linear models, and calibration of probabilities for logistic models. For test questions, lock onto the output: numbers mean linear regression; classes or class probabilities mean logistic regression. That single axis resolves almost every comparison item cleanly.
As a memory aid, ignore the shared word regression in the names and ask what you must emit for the business: a real-valued estimate or a class decision. Also remember both methods are supervised—they need labeled targets—so any option that calls linear regression unsupervised is immediately wrong. When stems mention price, demand, or temperature as numbers, think linear; when stems mention spam, fraud, or churn as categories, think logistic.