Supervised learning is one of the most common ways to start with machine learning. You give the model examples where the correct answer is already known, and the model learns patterns that connect inputs to labels.

The first practical decision is whether your problem is regression or classification.

Quick Answer

Use regression when the label is a continuous number, such as price, fare, duration, or weight. Use classification when the label is a category, such as fraud/not fraud, spam/not spam, churn/no churn, or approved/rejected.

Key Takeaways

  • Supervised learning requires labeled data.
  • Regression predicts numeric values.
  • Classification predicts categories.
  • Logistic regression is commonly used for binary classification.
  • The label type determines the model type and evaluation metric.

What Is Supervised Learning?

Supervised learning uses examples like this:

FeaturesLabel
customer age, account age, plan typechurn or not churn
pickup location, dropoff location, distancetaxi fare
transaction amount, merchant, locationfraud or not fraud
email text, sender, linksspam or not spam

The model learns from the relationship between features and labels.

Regression

Regression predicts a continuous numeric value.

Examples:

  • house price,
  • taxi fare,
  • delivery time,
  • customer lifetime value,
  • product demand,
  • baby weight,
  • temperature.

Regression asks: “How much?” or “How many?”

Common regression metrics include:

  • MAE,
  • MSE,
  • RMSE,
  • R-squared.

Classification

Classification predicts a category.

Examples:

  • fraud or not fraud,
  • churn or not churn,
  • spam or not spam,
  • approved or rejected,
  • high risk, medium risk, or low risk.

Classification asks: “Which class?”

Common classification metrics include:

  • accuracy,
  • precision,
  • recall,
  • F1 score,
  • ROC AUC,
  • confusion matrix.

How To Decide Between Regression And Classification

QuestionIf yesUse
Is the label a number with continuous meaning?Predict amount, time, price, distanceRegression
Is the label a category?Predict class, segment, outcomeClassification
Is the label yes/no?Predict probability and thresholdBinary classification
Are there multiple categories?Predict one of many labelsMulticlass classification

Logistic Regression In Plain English

Despite the name, logistic regression is commonly used for classification.

It takes a linear model and passes the output through a sigmoid function so the result becomes a probability between 0 and 1.

That is useful because many business questions are probability questions:

  • What is the probability this user will buy?
  • What is the probability this transaction is fraud?
  • What is the probability this email is spam?

After getting a probability, you still need a decision threshold.

For example:

  • if probability of fraud is above 0.80, flag it,
  • if probability of churn is above 0.65, send retention offer,
  • if probability of spam is above 0.90, move to spam folder.

Thresholds Matter

A classification model may output a probability, but the business often needs an action.

Changing the threshold changes the tradeoff:

  • a lower threshold catches more positives but may create more false alarms,
  • a higher threshold reduces false alarms but may miss more real positives.

Use precision, recall, and ROC curves to choose thresholds based on the real cost of mistakes.

Beginner Practice Exercise

Take five problems and classify them:

ProblemRegression or classification?
Predict monthly revenueRegression
Predict whether a loan defaultsClassification
Predict delivery timeRegression
Predict whether an image contains a product defectClassification
Predict house priceRegression

This habit prevents many early modeling mistakes.

FAQ

Can a numeric value become a classification problem?

Yes. You can turn a continuous value into categories. For example, a tip percentage can become low, average, or high.

Is linear regression only for straight lines?

Basic linear regression learns linear relationships, but features and transformations can make the model more expressive.

Is classification always yes or no?

No. Binary classification has two classes, while multiclass classification has three or more classes.

Bottom Line

Before training a model, identify the label. If it is a continuous number, think regression. If it is a category, think classification.