# Classification vs Regression

> The two main jobs of supervised learning. Classification picks a group and regression guesses a number. Then the simplest model for each.

**Course:** [Machine Learning](https://learn.benibix.com/learn/ai-machine-learning)  
**Time:** 12 min

**After this lesson you can:**

- Tell classification from regression
- Explain how linear regression fits a line
- Say what logistic regression gives back

## Classification or regression: picking a group or guessing a number

Classification puts each example into one of a few fixed groups, like spam or not spam. Regression guesses a number on a scale, like a price or a time. Both are supervised learning. The test is the answer: if it is a name from a list, it is classification. If it is an amount, it is regression.

The word regression is old. Francis Galton used it in 1886, to describe how very tall parents tend to have children closer to average height. It has nothing to do with going backwards. Today it just means guessing a number.

Linear regression is the simplest way to guess a number. It draws the straight line that best fits the data. Each feature gets a weight that pushes the answer up or down. The way to find that best line, called least squares, was first published in 1805, and it is still in daily use.

Its strength is that you can read it. A line that says each extra square metre adds 15 euros of rent is easy to explain and to check. Its weakness is the straight line. When the real link curves, a line misses, and the model underfits.

Logistic regression is for classification, despite its name. It adds up the features with weights, just as linear regression does. Then it bends the total into an S-shaped curve that stays between 0 and 1, so the result reads as a chance. A cut-off, often 0.5, turns that chance into a yes or a no.

The chance is often more useful than the yes or no. A bank might approve a loan above 0.8, send it to a person between 0.5 and 0.8, and refuse it below 0.5. Moving the cut-off trades one kind of mistake for the other. That is a choice about cost, not about the model.

People often pick the task by the data rather than by the question. 'Will this customer leave?' is classification, even if the data is all numbers. 'How many days until they leave?' is regression. Get the question right first. The choice of model follows.

## Which one to pick

1. **Pick classification.** When the answer is a name from a list, like spam, cat or approved.
2. **Pick regression.** When the answer is an amount, like a price, a time or a count.

![Two charts. On the left, linear regression: a straight line through scattered dots, giving a number such as a rent. On the right, logistic regression: an S-shaped curve from 0 to 1, cut at 0.5, giving a chance and then a yes or no.](https://learn.benibix.com/diagrams/ml-linear-logistic.svg)

### Example: Jack's two rent models

Jack fits a line to 300 flats in his town. It says the rent is 400 euros, plus 15 euros for each square metre.

For a 60 square metre flat, that gives 1,300 euros. His second model, a logistic one, gives the same flat a 0.9 chance of being let within a week.

**Words in this lesson:** [Classification (Machine Learning)](https://learn.benibix.com/term/ai/classification), [Regression (Machine Learning)](https://learn.benibix.com/term/ai/regression), [Linear Regression](https://learn.benibix.com/term/ai/linear-regression), [Logistic Regression](https://learn.benibix.com/term/ai/logistic-regression)

> **The one thing to remember.** Classification picks a group. Regression gives a number. Logistic regression, in spite of the name, picks a group.

**Question:** What job does logistic regression do?

**Answer:** Classification: it gives a chance, then a yes or no. It works out a chance between 0 and 1, and a cut-off turns that into a group. The name is history, from the line it starts with.

---

Source: https://learn.benibix.com/learn/ai-machine-learning/classification-vs-regression
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
