Features vs Labels
Features and labels are two of the most important parts of a supervised machine learning dataset. The easiest way to understand the difference is to ask: what information does the model receive, and what answer is it trying to predict?
Features are the information. The label is the answer.
Features describe an example and are used by the model as input. The label is the known result that the model is learning to predict.
House Price Example
Suppose we want to predict the price of a house.
The first three pieces of information describe the house. They are features.
The house price is the result we want to predict. It is the label.
See the Difference as a Flow
During training, the model sees the features together with the known label and learns the relationship between them.
Customer Purchase Example
Now let's use a completely different problem.
An online store wants to predict whether a customer will purchase a product.
29
5
12
Yes
Age, previous purchases, and website visits are the features.
"Purchased: Yes" is the label.
A Very Simple Question
When you are looking at a machine learning dataset, ask yourself two questions.
What information am I giving the model?
→ These are the features.What answer am I asking the model to predict?
→ This is the label.One Dataset Can Make This Very Clear
Imagine this small house dataset:
Here, the columns Size, Bedrooms, and Location are features.
The Price column is the label.
During Training vs After Training
There is an important difference between training and making a prediction for a new example.
The model learns from examples where the correct answer is already known.
The model uses the learned patterns to predict the unknown label.
For example, when predicting the price of a new house, we might know its size, bedrooms, and location, but not its final selling price yet.
Another Quick Example: Spam Detection
Suppose we want to build a model that identifies spam emails.
The email information is used as features. The answer "Spam" or "Not Spam" is the label.
Features Describe. Labels Answer.
Features are the input information used by the model. The label is the known result that the model learns to predict in supervised learning.
Which Is the Feature and Which Is the Label?
We want to predict whether a customer will buy a product.
Age and previous purchases provide information to the model. "Purchased: Yes" is the result the model is learning to predict.