MACHINE LEARNING • LESSON 5

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?

THE SIMPLE DIFFERENCE

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.

01

House Price Example

Suppose we want to predict the price of a house.

Information Type
House Size Feature
Number of Bedrooms Feature
Location Feature
House Price Label

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.

02

See the Difference as a Flow

FEATURES Size Bedrooms Location
MODEL Learns the Pattern
LABEL House Price

During training, the model sees the features together with the known label and learns the relationship between them.

03

Customer Purchase Example

Now let's use a completely different problem.

An online store wants to predict whether a customer will purchase a product.

FEATURE Age

29

FEATURE Previous Purchases

5

FEATURE Website Visits

12

LABEL Purchased

Yes

Age, previous purchases, and website visits are the features.

"Purchased: Yes" is the label.

04

A Very Simple Question

When you are looking at a machine learning dataset, ask yourself two questions.

Question 1

What information am I giving the model?

→ These are the features.
Question 2

What answer am I asking the model to predict?

→ This is the label.
05

One Dataset Can Make This Very Clear

Imagine this small house dataset:

Size Bedrooms Location Price
1,500 sq ft 2 City A $300,000
2,000 sq ft 3 City A $400,000
2,500 sq ft 4 City B $550,000

Here, the columns Size, Bedrooms, and Location are features.

The Price column is the label.

06

During Training vs After Training

There is an important difference between training and making a prediction for a new example.

DURING TRAINING Features + Known Label

The model learns from examples where the correct answer is already known.

NEW EXAMPLE Features Only

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.

07

Another Quick Example: Spam Detection

Suppose we want to build a model that identifies spam emails.

FEATURES Number of links Sender information Words in the email
LABEL Spam / Not Spam

The email information is used as features. The answer "Spam" or "Not Spam" is the label.

REMEMBER THIS

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.

QUICK CHECK

Which Is the Feature and Which Is the Label?

We want to predict whether a customer will buy a product.

Customer Age Feature
Number of Previous Purchases Feature
Purchased: Yes Label
Why?

Age and previous purchases provide information to the model. "Purchased: Yes" is the result the model is learning to predict.

NEXT TOPIC

Input and Output

Now that features and labels are clear, we will connect them to the broader idea of input and output in a machine learning model.