1. Definition

  • The target variable (also called dependent variable, response variable, or label) is the outcome you want to predict or explain.
  • It is the variable of interest, whose value depends (possibly) on other variables (features).

Formally:

  • In supervised learning, the dataset is $(X, y)$.
    • $X$ = input features (independent variables).
    • $y$ = target variable.

2. Examples

Regression (numeric target)

  • Predicting house price → Target variable = price (continuous).
  • Predicting demand → Target variable = units sold.

Classification (categorical target)

  • Predicting if an email is spam → Target variable = {spam, not spam}.
  • Predicting if a customer will churn → Target variable = churn (yes/no).

Time Series

  • Forecasting daily sales → Target variable = sales at time $t$.

3. Synonyms

  • Dependent variable (statistics, regression).
  • Response variable (general statistics).
  • Output / Label (machine learning, especially in classification).

4. Contrast with Features

  • Features (independent variables, predictors): Input used to predict.
    • Example: size, number of rooms, location.
  • Target variable: Output to predict.
    • Example: house price.

5. Importance

  • The choice of target variable defines the problem:
    • Continuous target → regression.
    • Categorical target → classification.
    • Sequence target → forecasting.

Summary:
The target variable is the variable you want to predict or explain in supervised learning or statistical modeling. It’s also called the dependent variable, response variable, or label, and it determines whether the problem is a regression, classification, or forecasting task.