Labeled and Unlabeled Data

What does labeled data mean in machine learning?

Labeled data is a dataset where each example has a label, the correct answer a model learns to predict. Learn how labels work and where they come from.

On this page
  1. Labeled data in one sentence
  2. Features and labels
  3. Two kinds of labels
  4. Where labels come from
  5. Why labels matter for supervised learning
  6. Costs and trade-offs
  7. Labeled versus unlabeled data
  8. Splitting labeled data
  9. Summary

Labeled data in one sentence

Labeled data is a dataset in which each example comes with a label: the correct answer or target value that a model is meant to learn to predict. A photo tagged “cat” or “dog,” an email marked “spam” or “not spam,” and a house record with its recorded sale price are all labeled examples.

Features and labels

Each labeled example has two parts:

  • Features are the inputs, the measurable details a model can use. Examples include pixel values in a photo, the words in an email, or the size and location of a house.
  • The label is the output: the answer attached to those inputs.
Example Features Label
Photo Pixel values “cat”
Email Words and sender details “spam”
House Size, bedrooms, location Sale price

Two kinds of labels

Labels come in two broad forms:

  • Categorical labels pick a class, such as “spam” or “not spam.” Models that predict these are usually used for classification.
  • Numeric labels are values, such as a sale price. Models that predict these are usually used for regression.

Both kinds count as labeled data.

Where labels come from

Labels are produced in a few ways:

  • People annotate examples by hand, such as drawing boxes around objects in images or marking emails as spam.
  • Existing records supply the labels, such as past sale prices or whether a customer stayed or left.
  • Automatic processes generate labels from system logs, sensor readings, or user actions such as clicks. Automatically generated labels can be noisy, so they often need checking.

Why labels matter for supervised learning

Supervised learning uses labeled data to learn a mapping from features to labels. During training, the model’s predictions are compared with the labels, and the model adjusts to reduce the gap. Labels also make testing possible, because you can check a prediction against a known answer. Without labels, that direct check isn’t available.

Costs and trade-offs

Labeling takes time and money, and it doesn’t always scale well. Labels can also be wrong or inconsistent. If two annotators label the same examples differently, the model learns from that disagreement. In practice, label quality often sets a limit on how well a supervised model can perform.

Labeled versus unlabeled data

The opposite of labeled data is unlabeled data, where examples have features but no label. Supervised learning needs labels, while unsupervised learning works with unlabeled data. When people ask which learning uses unlabeled data, the usual answer is unsupervised learning, and semi-supervised learning combines a few labels with many unlabeled examples.

Splitting labeled data

Labeled datasets are usually divided into parts. A training set is what the model learns from, a validation set helps tune choices, and a test set is used for a final check. Keeping the test set separate helps show how the model handles examples it did not learn from.

Summary

Labeled data pairs each example with the answer a model should learn to predict. That pairing is what supervised learning needs, and it’s also what makes evaluation possible. The main cost is the work of producing labels that are accurate and consistent.

The complete guide to labeled and unlabeled data

What Characterizes Unlabeled Examples in Machine Learning
Read the guide

Keep exploring

Guides from other topics

All topics →