Labels

What Are Labels?

A label is the correct answer assigned to a piece of training data. In supervised learning, the model is given both an input and the expected output (the label), and learns to predict labels from inputs.

Label Examples

Email — "Congratulations, you won money!" → Label: Spam

Image — Photo of a dog → Label: Dog

House — 1500 sq ft, Downtown → Label: $350,000

Why Labels Matter

Labels tell the model what the correct answer looks like. Without labels, the model cannot learn what it is trying to predict.

What Happens with Wrong Labels

A dog image is labeled as "cat."

The model now has incorrect training information.

Result — The model learns wrong patterns and makes poor predictions

Supervised Learning and Labels

Supervised Learning Examples

House price prediction — Features: size, location | Label: $350,000

Spam detection — Features: email text, sender | Label: Spam

Image recognition — Features: pixel values | Label: Dog

Medical diagnosis — Features: symptoms, lab results | Label: Diagnosis

Classification Labels

Binary Classification

Email — Spam (1) or Not Spam (0)

Tumor — Malignant (1) or Benign (0)

Transaction — Fraud (1) or Not Fraud (0)

Multi-Class Classification

Animal — Cat, Dog, or Bird

Language — English, French, or Spanish

Digit — 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Multi-Label Classification

Each example can have multiple labels.

Park scene image → Labels: Trees, People, Buildings, Sky

Regression Labels

Regression Label Examples
  • House price: $275,000
  • Temperature tomorrow: 22.4°C
  • Expected salary: $68,500
  • Time to complete task: 14.3 minutes

Regression labels are continuous numerical values, not discrete categories.

Student Dataset Example

Student IDStudy HoursAttendanceLabel (Pass/Fail)
001695%Pass
002260%Fail
003480%Pass

How Labels Are Used in Training

01

Collect data — Gather input examples

02

Assign labels — Add correct answers to each example

03

Split data — Divide into train, validation, and test sets

04

Train the model — Model learns to predict labels from features

05

Evaluate — Check how well predictions match true labels

06

Deploy — Use the model to predict on new unlabeled data

Prediction Error and Learning

Training Example

Features — Size: 1500 sq ft, Location: Downtown

Model Prediction — $250,000

Actual Label — $400,000

Error — $150,000

The model uses this error to update its parameters and make better predictions next time.

Good Labels vs Bad Labels

Good Labels
  • Correct and accurate
  • Consistent across similar examples
  • Applied following clear guidelines
  • Reviewed for quality
Bad Labels
  • Incorrect or inaccurate
  • Inconsistent
  • Applied without clear guidelines
  • Biased

Missing and Noisy Labels

Missing Label Example

Email dataset where 20% of emails have no spam/not spam label assigned.

  • Remove unlabeled examples
  • Have humans label them
  • Use semi-supervised learning
Noisy Label Example

One labeler marks "Great product!" as Positive.

Another labeler marks the same text as Neutral.

Problem — Inconsistent labels make training harder and reduce accuracy

Label Bias

Example

Hiring labels based on historical decisions may reflect past discrimination.

Result — The model will learn those biased patterns if the labels are not reviewed and corrected

Label Encoding and One-Hot Encoding

Label Encoding

Cat = 0

Dog = 1

Bird = 2

Simple but may imply ordering

One-Hot Encoding

Cat → [1, 0, 0]

Dog → [0, 1, 0]

Bird → [0, 0, 1]

No ordering implied

Loss Function and Labels

Example

Model predicts — 0.9 probability of Spam

True label — Not Spam

Loss — High (prediction was very wrong)

After training update:

Model predicts — 0.1 probability of Spam

Loss — Low (prediction is now correct)

Labels vs Predictions

Labels

Correct answers provided during training

Created by humans or known data

Used to measure model error

Predictions

Model's output on new data

Generated by the trained model

Compared to true labels during evaluation

Labels and Evaluation

TaskLabel TypeCommon Metrics
Binary Classification0 or 1Accuracy, Precision, Recall, F1
Multi-Class ClassificationCategory nameAccuracy, F1 (macro/micro)
RegressionNumerical valueMAE, MSE, RMSE, R²
Object DetectionBounding box + classmAP, IoU

Common Label Problems

Problems
  • Incorrect labels — Wrong categories assigned
  • Missing labels — Some examples have no label
  • Inconsistent labels — Same example labeled differently by different people
  • Biased labels — Labels reflect human prejudice
  • Ambiguous labels — Guidelines are unclear

Ways to Improve Label Quality

Best Practices
  • Write clear and specific labeling guidelines
  • Use multiple labelers per example
  • Measure inter-labeler agreement
  • Review and fix disagreements
  • Randomly audit labels for accuracy
  • Retrain when labels are corrected

Key Takeaways

Summary
  • Labels are the correct answers used to train supervised learning models
  • Without labels, the model does not know what it is trying to predict
  • Label quality directly affects model performance
  • Common problems include incorrect, missing, noisy, and biased labels
  • Good labels are correct, consistent, and created with clear guidelines
  • Labels must be encoded as numbers before most models can use them
  • The loss function uses labels to measure model error and guide training

Need Help?

Ask the AI if you need help understanding what labels are, how they are used in training, label encoding, or how to improve label quality.