When you build a Machine Learning model, one of the first questions you need to answer is:
What information should the model look at, and what should it predict?
This is where two fundamental concepts come into play:
Features and Labels.
Features provide the information a model uses to make a prediction. Labels represent the answer the model is trying to predict.
Understanding these concepts is essential because almost every supervised Machine Learning project can be reduced to a simple relationship:
Features → Machine Learning Model → Label
For example:
House Size
Bedrooms
Location
Age
↓
Machine Learning Model
↓
Predicted House PriceIn this article, we'll explore features and labels in detail, understand the difference between them, look at practical examples, discuss feature engineering, and examine common mistakes that can negatively affect Machine Learning models.
Features are the individual pieces of information that a Machine Learning model uses to make a prediction.
They are also commonly called:
Imagine building a model that predicts the price of a house.
The model might receive:
These are the features.
Area
Bedrooms
Bathrooms
Location
Property Age
Parking
↓
Machine Learning ModelThe model analyzes these inputs to predict the house's price.
A label is the target output that the model is trying to predict.
Labels are primarily associated with supervised learning.
For the house-price example:
Features:
Area = 1,500 sq ft
Bedrooms = 3
Bathrooms = 2
Location = Delhi
↓
Label:
₹85,00,000The label is the known answer in the training dataset.
During training, the model learns the relationship between the features and the label.
The simplest way to remember the difference is:
Features are what the model looks at. The label is what the model is trying to predict.
| Features | Label |
|---|---|
| Inputs | Output |
| Used to make predictions | Target being predicted |
| Known during prediction | Usually unknown at prediction time |
| Also called predictors | Also called target variable |
| Example: Age, income | Example: Will buy? |
Suppose we're building a model that predicts whether a customer will purchase a product.
Our dataset could look like this:
| Age | Previous Purchases | Website Visits | Purchased |
| 22 | 1 | 3 | No |
| 28 | 4 | 12 | Yes |
| 35 | 6 | 15 | Yes |
| 24 | 0 | 2 | No |
| 42 | 8 | 20 | Yes |
Here:
The model learns patterns such as whether customers with certain combinations of behavior are more likely to purchase.
Here's an important distinction.
During training, the model sees both:
Features + LabelDuring prediction, it generally receives only:
Featuresand produces:
PredictionFor example:
Age = 30
Previous Purchases = 5
Website Visits = 14
↓
Machine Learning Model
↓
Predicted Purchase = YesThe actual outcome isn't known yet.
The target variable is another name for the label the model is trying to predict.
For example:
Target:
House Price
Target:
Spam / Not Spam
Target:
Will Churn / Will Not Churn
Target:
Disease / No Disease
So you may see these terms used interchangeably:
The exact terminology varies by context.
Suppose you're building a spam detection model.
Features might include:
Label:
Spamor
Not SpamThe model learns from historical examples.
Features
↓
Model
↓
Spam / Not SpamNow consider house-price prediction.
Features:
Label:
₹85,00,000Unlike classification, the label is a continuous numerical value.
Features can look very different depending on the problem.
Suppose you're building a model to identify cats and dogs.
The raw image itself contains thousands or millions of pixel values.
Modern neural networks can learn useful visual representations automatically.
Conceptually:
Image Pixels
↓
Neural Network
↓
Cat / DogFor sentiment analysis:
"I absolutely loved this movie!"
↓
Text Representation
↓
PositiveThe model works with numerical representations of the text rather than simply treating the sentence as raw characters.
Features could include:
Label:
Fraudor
LegitimateFeature engineering is the process of creating, transforming, or selecting useful features from raw data.
It has historically been one of the most important parts of traditional Machine Learning.
Suppose you have:
Date of BirthInstead of giving the raw date directly to a model, you might derive:
AgeSimilarly:
Purchase Historycould become:
Average Monthly Spending
Purchase Frequency
Days Since Last PurchaseThese derived variables may provide the model with more useful information.
Raw data isn't always in the most useful form.
Consider a customer database containing:
Last Purchase DateA model might benefit more from:
Days Since Last Purchasebecause it directly represents customer recency.
Good feature engineering can make patterns easier for a model to learn.
Not every available variable is useful.
Feature selection involves identifying the features that provide meaningful information for the task.
Suppose you want to predict house prices.
Potential features:
Wall color may contribute little in some datasets compared with location or size.
Removing irrelevant features can sometimes:
However, whether a feature is useful should be determined through proper analysis and evaluation rather than assumptions alone.
Numerical features contain numbers.
Examples:
They can be:
Values can take many possible values.
Example:
Temperature = 27.63°CValues are countable.
Example:
Number of bedrooms = 3Categorical features represent groups or categories.
Examples:
For example:
Payment Method
Cash
UPI
Credit Card
Debit CardMachine Learning algorithms usually need categorical information converted into suitable numerical representations.
One common technique is one-hot encoding.
Binary features have two possible values.
Examples:
Is Premium Customer?
Yes / Noor:
Has Subscription?
1 / 0Binary variables are extremely common in Machine Learning datasets.
Consider this simplified dataset:
| Age | Income | Visits | Purchased |
| 21 | ₹30K | 2 | No |
| 29 | ₹65K | 8 | Yes |
| 34 | ₹80K | 10 | Yes |
| 25 | ₹35K | 3 | No |
The structure is:
Features
├── Age
├── Income
└── Visits
Label
└── PurchasedThe model studies the relationship between these columns.
Suppose the model receives:
Age = 29
Income = ₹65K
Visits = 8The correct label is:
Purchased = YesThe model makes a prediction.
If it predicts:
Nothe prediction is compared with the correct label:
Prediction: No
Actual: YesThe model calculates its error and adjusts its parameters.
This process happens repeatedly across many examples.
This is where things become interesting.
Suppose we have:
Age
Income
Visitsbut no:
PurchasedWe can't directly train a standard supervised model to predict purchases because the correct answers aren't available.
However, we could use Unsupervised Learning to discover patterns within the customer data.
For example:
Cluster A → Low engagement customers
Cluster B → Frequent buyers
Cluster C → High-value customersThis demonstrates an important difference:
Supervised Learning learns from labels.
Unsupervised Learning discovers patterns without labels.
Yes—but not in the same modeling setup.
A column can be used as a feature in one Machine Learning problem and become the target in another.
For example, consider:
Age
Income
Education
OccupationIf you're predicting Income, then Income is the label.
But if you're predicting Occupation, Income could potentially be a feature.
The role of a variable depends on the question you're trying to answer.
Suppose you're predicting whether a customer will cancel a subscription.
If you accidentally include:
Cancellation Dateas a feature, the model may effectively be given the answer.
This can create data leakage.
Adding every available column doesn't necessarily improve a model.
Irrelevant information can introduce noise and complexity.
Suppose you're predicting tomorrow's sales.
If one of your features contains information that becomes available only after tomorrow's sales are recorded, you've accidentally leaked future information into the model.
Raw information may not always be represented in the most useful way.
For example:
2026-08-18might be transformed into:
Day of Week
Month
Weekend / Weekdaydepending on the problem.
A feature that works well during training may behave differently in production.
For example, customer behavior could change dramatically after:
Models need to be evaluated against realistic future conditions.
Traditional Machine Learning often relies heavily on manually engineered features.
Deep Learning changed this significantly.
For example, in image recognition:
Traditional approach:
Image
↓
Manually engineered features
↓
Machine Learning algorithm
↓
PredictionDeep Learning:
Image
↓
Deep Neural Network
↓
Learned representations
↓
PredictionDeep Neural Networks can automatically learn useful representations directly from raw or minimally processed inputs.
However, this does not mean feature engineering has disappeared. Data representation, preprocessing, architecture, and task-specific transformations remain important.
Large Language Models process text using numerical representations.
A simplified pipeline looks like:
Text
↓
Tokenization
↓
Numerical representations
↓
Neural Network
↓
PredictionModern language models learn complex representations from enormous training datasets.
This is one reason they can capture relationships between words, phrases, concepts, and patterns in language.
Imagine building an AI system for an online store.
The goal:
Predict whether a customer is likely to purchase a product.
Potential features:
Label:
Purchased = Yes / NoThe model learns patterns from historical customer interactions.
Suppose a subscription company wants to predict which customers may cancel.
Features could include:
Label:
Churned = Yes / NoThe company could then investigate customers predicted to have a higher risk of churn.
These concepts define the Machine Learning problem itself.
Before selecting an algorithm, you should be able to answer:
What information does the model have?
→ Features
What should the model predict?
→ Label
If these questions aren't clearly defined, the Machine Learning project itself may not be clearly defined.
A feature is an input variable that provides information the model uses to make a prediction.
A label is the target output the model is trained to predict in supervised learning.
No. Features are inputs, while the label is the target output.
Labels are also called targets, target variables, outputs, or dependent variables.
Yes. Some Machine Learning tasks predict multiple outputs simultaneously.
Traditional unsupervised learning generally works without predefined labels.
Not necessarily. Deep Learning can automatically learn useful representations from raw data, although preprocessing and representation choices can still be important.
Features and labels may sound like simple terms, but they form the foundation of supervised Machine Learning.
A model needs meaningful information to make predictions, and it needs known outcomes during training so it can learn whether its predictions are correct.
Once you understand:
Features → Model → Label
the basic structure of many Machine Learning problems becomes much easier to understand.
From here, the next important question is:
What happens when a model becomes too good at memorizing its training data?
That's where one of the most important Machine Learning concepts comes in:
Overfitting and Underfitting.
Pixels to Perfection Design that Impresses