Step by Step
C
Classification — output is a discrete category
The target being predicted is a category chosen from a fixed, discrete set of possible labels, such as spam/not spam, or cat/dog/neither.
Example: predicting whether a tumor is benign or malignant — the output must be one of exactly two discrete categories.
R
Regression — output is a continuous number
The target being predicted is a continuous numeric value that can fall anywhere along a range, such as house price, temperature, or a patient's age.
Example: predicting a patient's exact age in years from medical scan data — the output is a continuous number, not a category.
⚠
The naming trap — logistic regression is actually a classifier
Despite having "regression" in its name, logistic regression is used for classification, not for predicting continuous numbers — a frequent source of confusion.
Example: logistic regression outputting a probability used to classify an email as spam or not spam, despite "regression" appearing in its name.
Applied Walkthrough
1
A model needs to predict tomorrow's exact rainfall amount in millimeters.
2
Ask: is the target a category or a continuous number? A continuous number — rainfall amount can be any value along a range.
3
This means the task is Regression, not Classification, regardless of which specific algorithm ends up being used.
4
Contrast: if the same task instead asked to predict whether tomorrow will be "rainy" or "dry" (two categories), that would flip the task to Classification instead.
Exam Application
Exams frequently test this distinction by describing a target variable and asking whether the task is classification or regression — always check whether the output is a discrete category or a continuous number first, since this single check resolves the vast majority of these questions.
⚠ Common Trap
The most common trap, baked directly into the mnemonic: assuming "logistic regression" must predict numbers because "regression" is in the name. It is fundamentally a classification algorithm, predicting discrete categories via a probability threshold, not continuous numeric outputs.
✓ Quick Self-Check
1. What kind of output does classification predict?
A discrete category, chosen from a fixed set of possible labels.
Tap to reveal / hide
2. What kind of output does regression predict?
A continuous number that can fall anywhere along a range.
Tap to reveal / hide
3. Is logistic regression a classification or regression algorithm, despite its name?
A classification algorithm — it predicts categories, not continuous numbers, despite "regression" appearing in its name.
Tap to reveal / hide
4. Would predicting a patient's exact age in years be classification or regression?
Regression, since age is a continuous number.
Tap to reveal / hide
5. What is the first question you should ask to determine whether a task is classification or regression?
Whether the target being predicted is a discrete category or a continuous number.
Tap to reveal / hide