Skip to content
Road to Intelligence

Concept · Chapter 3: Machine Learning

Features, Labels and Tasks

Must knowKnow well15 minDifficulty

A supervised learning problem is a table: each row is an example described by features, and the label is what the model must predict — a category (classification) or a number (regression).

The problem

To learn anything, the machine needs examples in a consistent numeric form, and a precise statement of what to predict.

The solution

Represent each example as a feature vector, attach the target label, and pick the task type from the label: discrete classes, continuous values, or (without labels) groups to discover.

The consequence

Almost any prediction problem can be framed this way — which is why data engineering (building good feature tables) is so much of practical ML.

The table view

As a data engineer you've seen this shape many times:

sq_mbedroomsagedistance_to_station_km→price (label)
1203150.8→410,000
651402.5→180,000

Each row is an example; the columns are features; the last column is the label. Machine learning finds a function ff such that f(features)≈labelf(\text{features}) \approx \text{label} — and, crucially, keeps working on rows it has never seen.

Three task shapes

  • Regression — the label is a number (price, demand, temperature).
  • Classification — the label is a category (spam/not spam, digit 0–9, next token out of 50,000). Most modern models, LLMs included, are classifiers at heart.
  • Clustering — no labels at all; group similar rows together (k-means).

What to remember

  • Features (inputs, x) describe an example; the label (target, y) is what to predict.
  • Classification: predict a category. Regression: predict a number.
  • Clustering: group unlabelled examples by similarity.
  • The model is a function f(x) ≈ y learned from many (x, y) pairs.