Machine LearningData Fundamentals

What is a target variable?

A target variable is the value that a supervised machine learning model is trained to predict.

It represents the desired output associated with each training example.

Simple example

Suppose we want to predict house prices.

Each sample might contain:

  • house size
  • number of bedrooms
  • location
  • age of the property
  • actual house price

Here, the first four values are features, while the actual house price is the target variable.

Features → Model → Predicted target

Targets can take different forms

A target variable may be:

  • Numerical, such as house price, temperature, or sales amount
  • Categorical, such as spam/not spam or approved/rejected
  • Binary, when there are only two possible outcomes

The type of target helps determine what kind of supervised learning problem is being solved. Numerical targets are commonly associated with regression, while categorical targets are commonly associated with classification.

Target vs feature

  • Features are the inputs used by the model.
  • Target is the output the model is trying to learn to predict.

In classification problems, the target is often also called a label. The concept of a label is covered separately.

In short, the target variable is the outcome a supervised machine learning model learns to predict from the input features.

#what is a target variable#target variable in machine learning#machine learning target variable#features vs target#target variable example#machine-learning#target-variable#features#supervised-learning#data-fundamentals

Learning Sequence

Machine Learning Curriculum

8% Completed
Up NextMachine Learning

What is a label in machine learning?

Explore Related Questions

Deepen your understanding across related Machine Learning topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.