Supervised learning: training models on labeled examples
Supervised learning is a machine learning approach that trains models on labeled examples, where each input has a known output. The model learns patterns from these examples and can predict labels for new data. Classification and regression are its two main task types.

What is supervised learning?
Supervised learning is a machine learning technique that uses labeled data sets to train AI models to identify patterns and relationships, as explained in IBM's overview IBM's supervised learning overview. The labeled data contains sample inputs along with the correct outputs, which serves as ground truth for the model.
According to the Google for Developers guide Google for Developers' supervised learning guide, each example in a dataset consists of features and a label. Features are the values the model uses to make a prediction, while the label is the answer the model aims to predict. For example, in a weather model, latitude and humidity are features, and rainfall amount is the label.
How supervised learning works
Supervised learning algorithms analyze a large dataset of labeled training pairs to infer the relationship between inputs and outputs, as described by Google Cloud Google Cloud's what is supervised learning. The model is then tested on new data to see if it can predict correct labels, and training continues until accuracy improves.
The Cornell lecture notes Cornell's supervised learning lecture notes formalize this process: training data consists of input vectors and labels drawn from an unknown distribution, and the goal is to learn a function that maps inputs to labels. The choice of function class, such as a decision tree or neural network, encodes assumptions about the problem.
Types of supervised learning
Supervised learning is generally divided into classification and regression. As AWS's comparative guide AWS's supervised vs. unsupervised learning explains, classification predicts categorical labels such as spam or not spam, while regression predicts continuous values such as house prices.
Within classification, there are several task types. IBM's classification article IBM's classification in machine learning distinguishes binary classification (two exclusive classes), multiclass classification (more than two exclusive classes), multilabel classification (nonexclusive classes), and imbalanced classification where classes have unequal representation.
Practical implementation
Many supervised learning algorithms are available in software libraries. The scikit-learn user guide scikit-learn's supervised learning user guide lists linear models, support vector machines, decision trees, ensemble methods, and neural networks, each suited to different data types and problem sizes.
When applying supervised learning, the quality and diversity of the labeled dataset play a considerable role in model performance. A model trained on a narrow range of examples may not generalize well to new situations, so practitioners should curate datasets that reflect the real-world distribution of the task.
| Type | Description |
|---|---|
| Binary classification | Two exclusive classes, such as spam or not spam |
| Multiclass classification | More than two exclusive classes, such as a set of image categories |
| Multilabel classification | Data points can belong to multiple nonexclusive classes |
| Imbalanced classification | Unequal distribution of data points across classes |
Frequently asked questions
What is a label in supervised learning?
A label is the known output or answer for a training example, such as spam or not spam for an email.
How does supervised learning differ from unsupervised learning?
Supervised learning uses labeled data with known outputs, while unsupervised learning finds patterns in unlabeled data.
What are common supervised learning algorithms?
Common algorithms include logistic regression, linear regression, decision trees, support vector machines, and neural networks.
What is the goal of training in supervised learning?
The goal is to update the model's parameters so it can predict correct labels for new, unseen data.