Learning outcomes

After this lesson, you will be able to:

Key idea. Regression and classification differ in the kind of answer we need to predict. Define the target and operational context before choosing an algorithm.
Regression estimates a quantity; classification assigns a categoryThe diagram shows shared input features X and two target types: a numeric value y or a class label.XFeaturessame input dataRegressionnumeric target yClassificationcategory / classOutputestimate / decision
Regression estimates a quantity; classification assigns a category. The target answer—not the input feature set—defines the task type.

1. Start with the question

Choosing between regression and classification does not begin with an algorithm or a dataset column. Start with the decision a person or system needs to make. Ask: what answer would be useful? Do we need to estimate a quantity, assign a category, or choose an action based on a prediction?

For a building, we might forecast tomorrow’s heat consumption in kWh, detect whether the current operating mode is faulty, or choose a control command. The first two can be regression and classification, respectively. Choosing a control command is a separate decision-making problem; it should not automatically be called classification.

2. Regression: predict a quantity

Target variable — the measured or labelled answer a model is expected to predict for each prediction unit and time horizon.
Regression is a task formulation in which the target variable is a numeric quantity and the model estimates its value.
The question sounds like “how much?”, “what is the magnitude?”, or “what value should we expect?”.

Examples include daily energy use in kWh, room temperature in °C, repair duration in hours, or water consumption in m³. Meaning and units matter: a prediction of 125 is underspecified unless we know that it means 125 kWh per day.

Define the target operationally: which measurement counts as the correct answer, over what period it is aggregated, and when the prediction must be available. If the goal is to forecast next day’s consumption, all input features must be available before that day begins.

3. Classification: assign a category

Classification is a task formulation in which the target variable represents one of a set of predefined categories and the model assigns an object to a class.
The question sounds like “which class does this object belong to?” or “did the event occur?”.

Examples include fault / normal, request type A / B / C, or pump / sensor / network failure. Classes need clear definitions and annotation rules. If two experts interpret “fault condition” differently, the problem begins in task definition and labeling, not in the algorithm.

Binary classification — choosing between two mutually exclusive classes.
Multiclass classification — choosing one class from three or more mutually exclusive categories.
Multilabel classification — assigning several labels to one object when multiple topics or properties may be present at the same time.

A single service request, for example, may concern both heating and electricity. These are different target structures.

4. What does the model actually output?

It is important to distinguish a model output from the decision that uses it.
Class probability — a model’s estimate of how plausible it is that an object belongs to a given class; it is neither a guarantee nor a decision.

A probability estimate of 0.82 does not mean the event is certain. It is a model estimate whose interpretation depends on calibration and data quality. The label “fault” is the result of applying a decision rule to that estimate.

5. Thresholds and the cost of errors

Classification threshold — a selected score boundary above which the system assigns the positive class or triggers a specified action.
In binary classification, a system may predict the positive class when the estimated event probability exceeds a chosen threshold. A threshold of 0.5 is a common starting point, not a universal law. If missing a dangerous fault is much more costly than sending a healthy unit for an extra inspection, the threshold may be lower. If a false alarm causes an expensive production shutdown, it may be higher.

A threshold should not be selected merely to make a metric look good. It must reflect the consequences of errors, inspection capacity, safety rules, and customer requirements. Detailed classification metrics and error analysis are covered in Theme 1.5.

6. Compare tasks in one example

Suppose a system monitors a pump. Temperature, vibration, pressure, and load are input features. The target depends on the question:
QuestionTargetTask formulation
How many hours until the next service?Number of hoursRegression
Is a confirmed fault present?Yes / noBinary classification
Which fault type was detected?One category from severalMulticlass classification
Which problems are present simultaneously?A set of labelsMultilabel classification

The input features may be identical, but the tasks are not. The target answer, the process used to obtain it, and the way the result is used are different.

7. Practice: check the formulation

For each scenario, identify the task type and define the target variable with its unit or allowed set of classes.
  1. Estimate a building’s water consumption over the next 24 hours.
  2. Determine whether a service request reports a leak.
  3. Assign one category to a request: heating, ventilation, water supply, or electrical.
  4. Mark every topic present in a single request message.

Then ask five clarifying questions: what is the prediction unit; how is the correct answer defined; what time period does it refer to; when must the prediction be available; and what happens after the result is received?

8. Common mistakes and boundaries

Choosing regression or classification does not automatically solve questions of causality, data quality, fairness, or safety. These are separate parts of problem design and evaluation.

9. Key takeaways