Supervised Learning
Supervised learning trains models on labeled input-output examples so they can predict labels for new data. Classification, regression, and training.
Supervised learning is the branch of machine learning (ML) in which a model learns to map inputs to outputs from labeled examples, inputs paired with the correct answer, often called the ground truth. During training the model's predictions are compared with those labels and its parameters are adjusted to reduce the difference. The goal is generalization: accurate predictions on new inputs the model has never seen. Many of the most widely deployed ML systems are supervised, including spam filters, credit scoring, demand forecasting, image classifiers, and object detectors.
How Supervised Learning Works#
A supervised dataset is a collection of (input, label) pairs, split into training data for fitting the model, validation data for tuning settings and choosing when to stop, and test data for a final, unbiased estimate of performance. For each training batch the model makes predictions, a loss function measures how far they are from the labels, and an optimization algorithm such as stochastic gradient descent updates the model weights to lower that loss. One pass over the training set is an epoch, and training usually runs for many epochs while the validation score is monitored.
A model that keeps lowering its training loss while its validation score gets worse is overfitting: it is memorizing the training labels, including their noise, instead of learning patterns that transfer. More data, data augmentation, regularization, and early stopping counter it.
Classification, Regression, and Structured Outputs#
- Classification: Predicts a discrete category, such as spam or not spam, or which of the 1,000 ImageNet classes an image shows.
- Regression: Predicts a continuous value, such as a house price, tomorrow's demand, or the distance to an object, with linear regression as the simplest model.
- Structured outputs: Many vision tasks combine both. Object detection classifies each object and regresses its box coordinates, segmentation classifies every pixel, and pose estimation regresses keypoint positions.
The same supervised recipe applies to very different models, from classic algorithms such as logistic regression, random forests, and gradient-boosted trees on tabular data to deep neural networks on images, audio, and text.
Labeled Data and Its Cost#
Labels come from human annotators, from records such as past fraud cases or purchases, and from instruments, and their quality caps the model's quality. Systematic labeling errors, inconsistent annotation rules, class imbalance, and data leakage between training and test sets are common causes of models that score well in development and fail in deployment. Because data labeling is often the most expensive part of a project, related methods cut the number of labels needed. Active learning asks annotators to label only the most informative samples, and transfer learning starts from a model pretrained on a large dataset, so a new task needs far fewer labeled examples.
YOLO26 training is supervised learning on labeled images: each training image has a label file listing every object's class ID and normalized box coordinates, and the train mode updates the model to reduce the loss between its predicted classes and boxes and those labels. This example fine-tunes pretrained weights on COCO8, an 8-image sample of the COCO dataset, with 4 training and 4 validation images, for checking that a training pipeline runs end to end:
from ultralytics import YOLO
# Start from weights pretrained on the full COCO dataset
model = YOLO("yolo26n.pt")
# Supervised training: images paired with box and class labels
results = model.train(data="coco8.yaml", epochs=3, imgsz=640)Supervised vs. Other Learning Paradigms#
- Unsupervised learning: Uses no labels and finds structure in the inputs alone, such as clusters or compressed representations.
- Semi-supervised learning: Trains on a small labeled set plus a large unlabeled one, often by assigning pseudo-labels to confident predictions on the unlabeled data.
- Self-supervised learning: Creates labels from the data itself, such as the next word in a sentence or a hidden patch of an image, and is how large language models and vision foundation models are pretrained before supervised fine-tuning.
- Reinforcement learning: Learns from rewards earned by actions in an environment, with no labeled correct action for each situation.
- Few-shot learning: Recognizes new classes from a handful of labeled examples, typically 1 to 10 per class, by building on knowledge from pretraining.










