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.
That decision starts with the label. If you understand what the model should predict, you can usually choose the right model type, metric, and evaluation approach.
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.
Regression answers “how much?” Classification answers “which class?” Many beginner mistakes happen when the label is not defined clearly before training starts.
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.
- The same business problem can sometimes be framed as regression or classification.
- Classification thresholds should be chosen based on the cost of mistakes.
What Is Supervised Learning?
Supervised learning uses examples like this:
| Features | Label |
|---|---|
| customer age, account age, plan type | churn or not churn |
| pickup location, dropoff location, distance | taxi fare |
| transaction amount, merchant, location | fraud or not fraud |
| email text, sender, links | spam or not spam |
The model learns from the relationship between features and labels.
Start With The Label
Before choosing an algorithm, write the label in plain language.
| Question | Example label | Likely problem type |
|---|---|---|
| How much will this cost? | fare_amount | Regression |
| How long will this take? | delivery_minutes | Regression |
| Will the customer churn? | churn_yes_no | Classification |
| Is this transaction suspicious? | fraud_yes_no | Classification |
| Which support category fits this ticket? | ticket_category | Multiclass classification |
| What demand is expected next week? | units_sold | Regression or forecasting |
If the label is unclear, the model will be unclear. A useful supervised learning project starts with a label that is measurable, available, and connected to a real decision.
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.
| Metric | What it helps with |
|---|---|
| MAE | Easy-to-understand average error |
| RMSE | Penalizes large errors more strongly |
| R-squared | Explains how much variation the model captures |
Use regression when the exact amount matters. For example, predicting delivery time as 43 minutes is a regression task. Turning it into “late” or “not late” makes it a classification task.
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.
| Metric | What it helps with |
|---|---|
| Accuracy | Overall correctness when classes are balanced |
| Precision | How often positive predictions are correct |
| Recall | How many actual positives are found |
| F1 score | Balance between precision and recall |
| Confusion matrix | Shows where predictions are wrong |
Use classification when the decision is about a class or action. For example, “approve or reject,” “high risk or low risk,” and “spam or not spam” are classification tasks.
How To Decide Between Regression And Classification
| Question | If yes | Use |
|---|---|---|
| Is the label a number with continuous meaning? | Predict amount, time, price, distance | Regression |
| Is the label a category? | Predict class, segment, outcome | Classification |
| Is the label yes/no? | Predict probability and threshold | Binary classification |
| Are there multiple categories? | Predict one of many labels | Multiclass classification |
Same Problem, Different Framing
Some business problems can be framed more than one way.
| Business question | Regression framing | Classification framing |
|---|---|---|
| Customer churn | Predict churn probability or expected revenue loss | Predict churn / no churn |
| Delivery operations | Predict delivery minutes | Predict late / not late |
| Loan risk | Predict expected loss amount | Predict default / no default |
| Support prioritization | Predict expected resolution time | Predict high / medium / low priority |
| Sales forecasting | Predict revenue amount | Predict will hit target / will miss target |
The best framing depends on the action. If the business needs an exact number, regression may fit. If the business needs a decision category, classification may fit better.
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.
| Lower threshold | Higher threshold |
|---|---|
| Catches more likely positives | Creates fewer false alarms |
| Can increase recall | Can increase precision |
| May create more manual review work | May miss important cases |
| Useful when missing a case is costly | Useful when false alarms are costly |
For fraud, a lower threshold may be acceptable if the review team can handle more alerts. For customer retention, a lower threshold may create too many unnecessary offers. Thresholds are business decisions, not only technical settings.
Real-World Example
Imagine a company wants to identify customers who may cancel their subscription.
The team could frame the problem as classification: churn or no churn. That helps customer success teams decide which accounts need outreach.
The team could also frame the problem as regression: expected revenue at risk. That helps leadership prioritize accounts by potential business impact.
Both framings may be useful, but they answer different questions. The classification model helps decide who needs attention. The regression model helps estimate how much revenue may be affected.
This is why supervised learning starts with the decision, not the algorithm.
Beginner Practice Exercise
Take five problems and classify them:
| Problem | Regression or classification? |
|---|---|
| Predict monthly revenue | Regression |
| Predict whether a loan defaults | Classification |
| Predict delivery time | Regression |
| Predict whether an image contains a product defect | Classification |
| Predict house price | Regression |
This habit prevents many early modeling mistakes.
Common Beginner Mistakes
- choosing a model before defining the label
- using regression when the business needs a decision category
- using classification when the business needs a numeric estimate
- judging classification only by accuracy when classes are imbalanced
- ignoring the cost of false positives and false negatives
- treating logistic regression as a regression model because of the name
- training before checking whether labels are reliable
- using features that would not exist at prediction time
Official Resources
- Google Machine Learning Crash Course: Supervised learning
- Google Machine Learning Crash Course: Classification
- Scikit-learn supervised learning guide
Related AI Charcha Reading
- Launching Into Machine Learning: A Practical Learning Path
- Data Quality And EDA For Machine Learning
- Model Evaluation, Generalization, And Sampling
- BigQuery ML Beginner Guide
- Data Preprocessing Options for Enterprise ML
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.
Good supervised learning starts with a clear question, a trusted label, useful features, and the right metric. Once those are clear, the model choice becomes much easier.