AI Glossary / Mathematics and optimization / Beginner
Label space
Definition
A label space is the set of all permitted target values for a machine-learning task. Usually written Y, it describes what the system is intended to predict. It may contain category names, numbers, vectors, or structured objects, including valid target values that do not appear in the available training data.
What it means
Choosing a label space is part of defining the problem. A system that predicts one product category has a different target from a system that predicts every applicable product tag. A system that predicts tomorrow's temperature also has a different target from one that predicts a temperature band.
The label space describes admissible answers, while a dataset records particular observed answers. These need not be identical. If a training sample contains no examples of one permitted category, the category does not automatically cease to exist. Its absence instead raises a coverage question for learning and evaluation.
Numerical encoding should not be confused with meaning. Assigning category identifiers 0, 1, and 2 does not by itself make the categories ordered or make their differences measurable quantities.
How it works
Start with the decision the prediction should support. Specify whether an example can have one target, several simultaneous targets, a numerical measurement, or a structured response. Then define the admissible values and any constraints between them.
For single-label classification, a finite set such as {billing, delivery, account} can be sufficient. For three independent binary tags, the label space may be {0,1}³, containing eight possible combinations. Constraints can exclude combinations that are impossible in the application.
The model's internal output need not be a label directly. Three class scores or probabilities can be converted into one category by a decision rule. That probability vector describes uncertainty over the categories; it should not silently replace the original definition of what counts as a correct target.
Three practical examples
- A customer-service classifier can use a fixed set of request categories so that predicted labels map to recognizable routing choices.
- A forecasting system can define a target as nonnegative demand measured in units, making the target's scale and permitted range explicit.
- A document-tagging system can allow several topics simultaneously, requiring a combination of tags rather than a single winning category.
Think of it this way
Think of the label space as the allowed answer format on a carefully designed form. A single-choice field, a multiple-choice checklist, and a numerical field invite different answers. The analogy captures the specification, but machine-learning label spaces can be infinite or structured, and defining a field does not guarantee that people fill it in accurately.
Worked example
Consider an original document-triage task with three topics: billing, delivery, and account. Under a single-label policy, Y has three elements. Each document must receive exactly one topic, even if several subjects are discussed. A training sample containing only billing and delivery documents still belongs to the three-category task; the sample simply lacks account examples.
Now change the policy to permit every applicable topic. Represent a target as (b,d,a), with each component either zero or one. Without additional restrictions, there are 2×2×2=8 possible labels. The vector (1,1,0) means billing and delivery together. The vector (0,0,0) means none of the three topics. If the policy requires at least one topic, exclude that vector and the label space has seven elements.
Suppose a model produces scores (0.6,0.3,0.1). For the single-label task, an argmax rule chooses billing. For the multiple-tag task, independently thresholding these particular scores at 0.25 would select billing and delivery. This second rule is only an illustrative policy: single-label probabilities that sum to one are not automatically appropriate independent tag probabilities.
Changing from one topic to several changes what annotations mean, which outputs are valid, and how predictions should be evaluated. It is more than changing a display widget.
Illustrative case study
In a fictional logistics company, an initial model assigns each message exactly one issue category. Reviewers later ask to preserve both delivery and billing issues when they occur together. The project team documents the revised label space and updates the annotation instructions before collecting new examples.
It retains the old dataset's version because old single-category annotations cannot reveal which additional topics reviewers would have selected. The team also defines how an empty tag set should be interpreted. This prevents missing annotations from being mistaken for confirmed absence of all issues. The scenario illustrates a design process, not a reported deployment or measured improvement.
Common misconceptions and mistakes
Do not infer the complete label space solely from distinct values observed in one file. Do not treat arbitrary category codes as quantities with meaningful arithmetic. Do not confuse an unknown target with a special target category unless the task explicitly defines that category.
Also distinguish a label space from a feature space: features describe the inputs, while labels describe the targets. A probability simplex used for predictive probabilities is related to a categorical label space but is not the same set. Finally, expanding the permitted labels does not automatically teach an existing model to recognize new categories.
Business use
A clear label-space specification helps teams align annotation, training, evaluation, and downstream actions. Record names, definitions, allowed combinations, units, boundary rules, and how missing targets are represented. For ordered categories, state the order without assuming that neighboring categories are equally far apart.
Review whether the permitted targets support the actual decision. A coarse category may be easy to annotate but insufficient for routing. A very detailed taxonomy may create categories with little reliable training evidence. These are design trade-offs to assess using examples and operational needs, rather than assuming more labels always produce a better system.
People also ask
Must every valid label appear in training data?
No. The declared label space can be larger than the observed set, although missing coverage affects what a model can learn reliably.
Are integer category codes numerical measurements?
Not necessarily. They can be identifiers with no meaningful ordering or arithmetic.
Is a multilabel task the same as multiclass classification?
No. A usual multiclass task selects one class; a multilabel task permits several labels together.
Check your understanding
Four binary tags allow any combination, including no tags. How many possible target vectors are there?
Answer: 2⁴=16. If at least one tag is required, exclude the all-zero vector, leaving 15.
Related terms
- Label
- Label vector
- Feature space
- Ordinal regression
- multiclass classification
- multilabel classification
- regression
- annotation
- target variable
Learn next
Next, write a label-space specification for one familiar task, including three valid answers and two invalid answers. Then study label vectors to understand how individual targets are stored in alignment with dataset rows.
More in Mathematics and optimization
- Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
- Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
- Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
- Σ-algebra
- Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
- Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.
Sources
Primary terminology reference: Alexander Jung and contributors, The Aalto Dictionary of Machine Learning, entries on label space and labels: https://aaltodictionaryofml.github.io/ADictML_Main.pdf . The examples, policy comparisons, and combination counts in this article are original illustrations.
Previous: Label shift Next: Label vector