# Data labeling

> Canonical: https://skillalmanac.com/glossary/data-labeling | Last verified: 2026-11-25 | Index status: index-eligible

Data labeling is the work of attaching tags, called labels, to raw data such as images, text or audio, so that a machine learning model can learn from examples that carry the right answer.

Also called: data annotation, data labelling, labeled data, AI data annotation, annotated data.

## In plain language

Data labeling means people, often helped by software, mark up raw data with the answer you want a model to learn. Someone tags each photo as cat or dog, or marks each email as spam or not spam. It is like a teacher writing the correct answer next to each practice question before a student studies them. The limit is that the model learns whatever the labels say, including the mistakes. Labelling at scale can be slow and costly, and careful projects add quality checks, for example by having a second person review a sample. Labelled data that has been checked is also what a model is later tested against.

## Technical definition

Labeling, also called data annotation, is a preprocessing step in supervised machine learning. Each raw item, such as an image, a sentence or a video clip, is paired with one or more labels, producing the labeled examples a model trains on. Google's machine learning glossary defines a labeled example as one that contains one or more features and a label. Workflows use a private workforce or a vendor, and some use a model to choose which items need a human, as in the AWS documentation. AWS describes validating automated labels against human-labeled data and routing uncertain items to human workers; that comparison does not make either set infallible.

## How it shows up when you use agents

When you use a model through Claude Code or Codex, in a typical agent session you do not label anything. Labeling happened earlier, when the provider built the data a model learned from. It returns when you build your own checks. A test set for a prompt or an agent is a set of labeled examples: an input and the answer you expect. Each label in it is a judgement someone made, and the later scores are only as trustworthy as those judgements.

The labels you write become the [ground truth](/glossary/ground-truth) your results are compared with, and they are what a [supervised learning](/glossary/supervised-learning) model trains on. The skill [llm-eval-test-sets](/skills/skill-almanac/llm-eval-test-sets) builds an eval dataset with a checker for duplicates, missing graders and leakage.

What breaks when labeling is misunderstood: people treat labels as facts, then blame the model when it scores badly on cases the labels got wrong. A next action is to read a sample of your labels by hand, ask a second person to label the same sample, and look at where you disagree before you build anything on the set. This is a form of [human in the loop](/glossary/human-in-the-loop) work, and it takes time. Then run [split-leakage-check](/skills/skill-almanac/split-leakage-check) so the same item does not appear in both training and test files.

## Common confusions

- **Data labeling versus ground truth.** Labeling is the activity of adding labels. Ground truth is the label set, once it is verified, that you treat as the reference. See [Ground truth](/glossary/ground-truth).
- **Labeled versus unlabeled data.** Supervised learning needs labeled examples. Unsupervised learning works on data with no labels. See [Unsupervised learning](/glossary/unsupervised-learning).
- **Human versus automated labeling.** The two are often mixed. The AWS documentation describes an automated process that uses machine learning to decide which data needs to be labeled by humans.
- **Myth.** A label is correct because it exists. Labels come from people or tools that can disagree or err; compare a sample with an independently checked reference.

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A check of train, validation and test files for duplicates, shared groups, time and label leakage, printed as JSON.

Why it exercises the concept: Labeled data is usually divided into splits. This skill checks that the same item, or the same label information, does not sit on both sides of a split.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An eval dataset for an LLM feature, built and validated with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: An eval set is a small labeled dataset: each case needs the expected answer or a grader. The checker shows what a flawed labeled set looks like.

### [huggingface-datasets](https://skillalmanac.com/skills/huggingface/huggingface-datasets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Dataset metadata, rows, search and filters read through the Hugging Face Dataset Viewer API.

Why it exercises the concept: Public labeled datasets are hosted there. Reading the rows lets you see what the labels look like before you rely on them.

### [regex-from-labeled-examples](https://skillalmanac.com/skills/skill-almanac/regex-from-labeled-examples)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A Python regular expression proposed from labeled match and non-match strings, then proved against every supplied example in a row-by-row table.

Why it exercises the concept: It is labeling at small scale: each string carries a label, and the table shows where the result disagrees with a label.

## Related terms

- [Ground truth](https://skillalmanac.com/glossary/ground-truth.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)
- [Training data](https://skillalmanac.com/glossary/training-data.md)
- [Human in the loop (HITL)](https://skillalmanac.com/glossary/human-in-the-loop.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)

## Sources

- [Machine Learning Glossary: labeled example](https://developers.google.com/machine-learning/glossary#labeled-example), Google for Developers (accessed 2026-11-24)
- [Training data labeling using humans with Amazon SageMaker Ground Truth](https://docs.aws.amazon.com/sagemaker/latest/dg/sms.html), Amazon Web Services (accessed 2026-11-24)
- [Automate data labeling: How it works and Accuracy](https://docs.aws.amazon.com/sagemaker/latest/dg/sms-automated-labeling.html), Amazon Web Services (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
