Clues in, answer out

Features are the information a model receives. The target is the value or class it is trying to learn to predict.

The idea

Imagine deciding whether to carry an umbrella. Temperature, clouds, and humidity are clues; whether it rains is the outcome you care about.

One row is an observation. Its feature vector is x, and its target is y. Supervised learning uses many (x, y) pairs to fit a prediction rule.

How it works

  1. Choose the unit of observation: one customer, image, match, transaction, time window, or other example.
  2. Define features that are available at the moment a prediction must be made.
  3. Define the target precisely, including its time horizon and labeling rule.
  4. Check for leakage, missing values, inconsistent units, duplicate rows, and labels that encode a different question than the one you intend to solve.

The supervised-learning data shape

n is the number of examples and p is the number of input features. The target space 𝒴 depends on the task: real numbers for regression, class labels for classification, and so on.

X ∈ ℝⁿˣᵖ, y ∈ 𝒴ⁿ

Check your understanding

Which item should be kept separate as the answer the model is trying to predict?

Answer and explanation

The target is the answer being predicted. Features are inputs used to estimate it.

A common misconception

A feature being correlated with the target does not prove it is causal, safe to use, or available at prediction time.

Open Data Cleaning lab

ML Basics

Learn the learning loop before diving into individual models: data, splits, regression, and probabilities.

  1. Clues in, answer out
  2. Practice is not the exam
  3. Fit a straight-line rule
  4. Turn a score into a probability