← Back to all tipsNovember 15, 2026

Classification vs regression: the first decision in any ML project

Before choosing a model, a dataset, or a vendor, every supervised machine learning problem starts with one question: are you predicting a category, or a number? Get this wrong and nothing downstream — the model, the evaluation, the way results get used — lines up correctly.

The actual distinction

Classification predicts a discrete label from a known set: fraud or not fraud, which of five support categories a ticket belongs to, whether a transaction is high-risk. The output is always one of a fixed number of possibilities.

Regression predicts a continuous value with no fixed set of outcomes: next month's revenue, a house's price, how many days until a machine fails. There's no "class" the answer belongs to — just a number on a scale.

The naming trap

Confusingly, "logistic regression" is a classification method, not a regression one — it predicts the probability of a class, then applies a threshold to pick one. This naming accident has confused more students than any other term in the field, so it's worth saying plainly: the name of a technique doesn't tell you which problem type it solves.

Why the distinction changes everything downstream

The two task types use different loss functions during training (cross-entropy for classification, something like mean squared error for regression), different evaluation metrics (accuracy, precision and recall for classification; mean absolute error or R² for regression), and different ways a "wrong" prediction is interpreted — being off by $5 on a price prediction is a very different kind of wrong than classifying a fraudulent transaction as legitimate.

The question that's easy to get wrong

Some problems look like they could go either way. "Will this customer churn in the next 30 days?" is naturally classification (yes/no). "How many days until this customer churns?" is the same underlying business question reframed as regression, and it's a strictly more informative answer when the data supports it — knowing a customer is at risk in 3 days versus 90 days changes what you'd actually do about it. Picking the framing that matches the decision you need to make, not just the data you happen to have, is the real first step of the project.

classification
Points split into two classes by a decision boundary
regression
A continuous line fitted through scattered points
Classification draws a boundary between classes; regression fits a line through a scale.

Classification scales past two classes

Nothing about the distinction changes once there are more than two classes — predicting one of twenty support categories or one of several thousand nodes in a product taxonomy is the same underlying technique as fraud/not-fraud, just with more possible outputs and correspondingly more room to be confidently wrong in a way plain accuracy won't catch. That's what makes precision and recall worth understanding before trusting a single accuracy number on any classifier with more than a couple of classes.