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.
Email — "Congratulations, you won money!" → Label: Spam
Image — Photo of a dog → Label: Dog
House — 1500 sq ft, Downtown → Label: $350,000
Labels tell the model what the correct answer looks like. Without labels, the model cannot learn what it is trying to predict.
A dog image is labeled as "cat."
The model now has incorrect training information.
Result — The model learns wrong patterns and makes poor predictions
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
Email — Spam (1) or Not Spam (0)
Tumor — Malignant (1) or Benign (0)
Transaction — Fraud (1) or Not Fraud (0)
Animal — Cat, Dog, or Bird
Language — English, French, or Spanish
Digit — 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Each example can have multiple labels.
Park scene image → Labels: Trees, People, Buildings, Sky
Regression labels are continuous numerical values, not discrete categories.
| Student ID | Study Hours | Attendance | Label (Pass/Fail) |
|---|---|---|---|
| 001 | 6 | 95% | Pass |
| 002 | 2 | 60% | Fail |
| 003 | 4 | 80% | Pass |
Collect data — Gather input examples
Assign labels — Add correct answers to each example
Split data — Divide into train, validation, and test sets
Train the model — Model learns to predict labels from features
Evaluate — Check how well predictions match true labels
Deploy — Use the model to predict on new unlabeled data
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.
Email dataset where 20% of emails have no spam/not spam label assigned.
One labeler marks "Great product!" as Positive.
Another labeler marks the same text as Neutral.
Problem — Inconsistent labels make training harder and reduce accuracy
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
Cat = 0
Dog = 1
Bird = 2
Simple but may imply ordering
Cat → [1, 0, 0]
Dog → [0, 1, 0]
Bird → [0, 0, 1]
No ordering implied
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)
Correct answers provided during training
Created by humans or known data
Used to measure model error
Model's output on new data
Generated by the trained model
Compared to true labels during evaluation
| Task | Label Type | Common Metrics |
|---|---|---|
| Binary Classification | 0 or 1 | Accuracy, Precision, Recall, F1 |
| Multi-Class Classification | Category name | Accuracy, F1 (macro/micro) |
| Regression | Numerical value | MAE, MSE, RMSE, R² |
| Object Detection | Bounding box + class | mAP, IoU |
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.