Learning outcomes
After this lesson, you will be able to:
- Distinguish regression from classification by the meaning of the target, not by an algorithm's name.
- Define the prediction unit, target variable, measurement unit, and forecast horizon.
- Distinguish a numeric prediction, a probability estimate, a model score, and a final decision.
- Explain binary, multiclass, and multilabel classification.
- Understand why a classification threshold depends on the task and the cost of errors.
- Check whether the chosen task type answers the real operational question.
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
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
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.
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.- In regression, a model usually outputs a numeric estimate of the target quantity.
- In classification, a model may output a confidence or probability estimate for each class.
- A rule then converts those scores into a label: for example, by selecting the most likely class or comparing an event probability with a threshold.
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
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:| Question | Target | Task formulation |
|---|---|---|
| How many hours until the next service? | Number of hours | Regression |
| Is a confirmed fault present? | Yes / no | Binary classification |
| Which fault type was detected? | One category from several | Multiclass classification |
| Which problems are present simultaneously? | A set of labels | Multilabel 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.- Estimate a building’s water consumption over the next 24 hours.
- Determine whether a service request reports a leak.
- Assign one category to a request: heating, ventilation, water supply, or electrical.
- 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 a task by algorithm name. The same algorithm family may have classification and regression variants. Define the target first.
- Treating a class code as a quantity. Codes 1, 2, and 3 may represent categories, not a numeric scale.
- Confusing probability with a decision. A model estimate and an operator’s action are different stages.
- Leaving out the time horizon. “Forecast the load” is ambiguous without a period and feature-availability time.
- Leaving classes undefined. Vague categories lead to inconsistent labels.
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
- Regression estimates a numeric target; classification assigns a category.
- The task type follows the meaning of the target, not an algorithm’s name or the data column’s storage format.
- A class probability and a final label are not the same thing.
- A classification threshold should reflect error costs and the operational workflow.
- A sound formulation defines the prediction unit, target, time horizon, and how the result will be used.