Skip to content
Machine Learning · Concept guide

Regression, Classification and Clustering Explained

Choose the learning task by the question and the available outcomes.

Part of the Machine Learning track: modules, projects and first roles →

By the GullyMentor team · 5 min read · Published 2026-10-18 · Updated 2026-11-06 · Sources listed at the end. Not a promise about mentorship outcomes.

Regression predicts a number, classification predicts a category from known labels, and clustering finds groups when no label is supplied. Pick the task from the question you are asked and the outcome you actually have recorded. Do not pick it from the algorithm you learned most recently.

How do you choose the task?

Ask two questions. First, do you have a recorded outcome for past examples? If not, you are exploring, and clustering is a candidate. Second, if you do have an outcome, is it a quantity or a category? A quantity such as minutes points to regression. A category such as "breached target" or "did not" points to classification.

The same data can support more than one task. Support tickets could be used to predict the exact hours to first reply (regression) or whether the reply will miss a stated target (classification). The business decision decides which is more useful.

Regression: estimate a number

For a fictional delivery service, predict minutes from order acceptance to delivery. Inputs must be available when the order is accepted, such as distance, time of day and item count. Compare errors in minutes so the result is easy to explain.

If the actual duration is 40 minutes and the prediction is 30, the absolute error is 10 minutes. Report the average of such errors next to a simple baseline, for example predicting the median delivery time every time. If your model cannot beat that baseline, it is not adding value yet.

Classification: predict a defined category

A support team might predict whether a ticket will breach a stated response target. Define the label and the observation window before building features. "Breach" must mean one exact thing, measured the same way for every ticket.

Check false positives and false negatives separately. Flagging a routine ticket may waste attention. Missing a serious case may delay help. Accuracy alone hides those different costs, so also look at precision and recall. The guide on how to evaluate a machine learning model walks through these with numbers.

Clustering: explore similarity

Group fictional customers by purchase frequency and typical spend. There is no supplied "correct segment" in this exercise, so you cannot compute accuracy. Feature scaling and distance choices change which customers appear similar. A feature measured in thousands will dominate one measured in single digits unless you scale both.

A cluster is not automatically a meaningful business category. Inspect whether the grouping is stable when you change the random seed or drop a few rows. Ask whether it helps answer a real question. Avoid attaching personal or sensitive interpretations to mathematical groups.

Compare the outputs

TaskExample outputUseful check
Regression35-minute estimateError in minutes against a baseline
ClassificationLikely target breachPrecision, recall and error costs
ClusteringGroup assignmentStability and practical interpretability

A worked example in steps

Take one fictional dataset of 500 online course enquiries with fields for topic, hour submitted, message length and whether the person later booked a call.

1. Classification: predict "booked a call" yes or no. The label is the booking field. 2. Regression: predict hours until the first reply. The target is a number, so use a regression model. 3. Clustering: drop the booking field and group enquiries by topic and message length. Look at each group and describe it in one sentence.

Notice that the data did not change. Only the question and the target did.

Common mistakes

  • Using a regression model on a category coded 1, 2, 3. The model will treat 3 as bigger than 1, which is meaningless for labels.
  • Treating a clustering result as ground truth. It is a description of the data you gave it.
  • Including a field that is only known after the outcome, such as the final booking date when predicting booking.
  • Reporting accuracy for a rare class without a baseline.

How do you check you understood?

Write three questions about the same fictional dataset, one for each task. For each, name the target (or say there is none), list the fields you would not know at prediction time, and state which check you would use. If a friend can tell which task each question is without you saying, you have it.

What to build next

Try one small notebook per task with scikit-learn on a synthetic dataset, then move to a project from the machine learning project ideas guide. The Machine Learning track shows where these ideas fit in a longer path.

The common mistake is treating the task labels as levels of difficulty. Each can be simple or complex. The right choice depends on the question, the evidence and the intended use.

Sources & further reading

Examples and practice recommendations are educational illustrations. Tool documentation and programme inclusions should be checked for your intended use.

Continue learning

Enquire now