Label (Target)
A label is the correct answer attached to a training example — the thing a supervised model is trying to predict, such as 'spam' or a house's actual price.
Data & AI
In supervised learning, every training example pairs input features with a label. The model learns the mapping from features to label so it can predict labels for new data where the answer isn't known.
Labels can be categories (cat vs. dog) for classification, or numbers (a price) for regression. Labeling data by hand is often the most expensive and time-consuming part of building a dataset.
Examples
Python
X = [[5.1, 3.5], [6.2, 2.9]] # features
y = ["setosa", "versicolor"] # labels
for features, label in zip(X, y):
print(features, "->", label)Output:
[5.1, 3.5] -> setosa
[6.2, 2.9] -> versicolor