Supervised learning
Supervised learning trains models from examples that include the correct answers (labels). The workflow is:- Provide inputs (features) and their corresponding labels.
- The model makes predictions from inputs.
- A loss function compares predictions to labels.
- The model updates its parameters to reduce the loss.
- House-price prediction: each past home has features (square footage, bedrooms, neighborhood) and a final sale price. The model learns to predict that numeric target (regression).
- MNIST: a dataset of handwritten digits where each image is paired with the correct digit (0–9). The task is image classification — learn a mapping from pixels to digit labels.
- ImageNet: a large image dataset organized around object categories. Models classify images into many categories (dogs, cars, birds, etc.). It follows the same supervised pattern: each image has a known label and the model learns from those labeled examples.

Unsupervised learning
Unsupervised learning finds structure, patterns, or groups in data that has no labels. Because there is no “correct answer,” the model looks for useful structure in the inputs themselves. Common use cases:- Clustering similar items together (customer segmentation, image grouping).
- Dimensionality reduction for visualization or preprocessing (PCA, t-SNE, UMAP).
- Density estimation and anomaly detection.
- Houses without sale prices: given only features (sqft, beds, area), an unsupervised model can discover clusters such as downtown condos, suburban family homes, or luxury properties.
- Customer segmentation for streaming services: group users by viewing behavior (fans of a sport, binge-watchers, early-morning kids’ programming viewers) without manual labeling.


Quick comparison
Label types in supervised learning
A useful follow-up distinction in supervised tasks is the type of label you predict:- Regression — predict continuous numeric values (e.g., house price).
- Classification — predict discrete categories (e.g., spam vs. not spam, digit 0–9).
Regression predicts continuous numeric targets. Classification predicts discrete labels. Both require labeled training data and are therefore supervised learning tasks.
Example dataset (house prices)
This table shows features (sqft, beds, area) and a numeric label (
price), which makes the supervised task a regression problem.
Key takeaways
- Supervised learning: model learns to predict known labels from input features (regression, classification).
- Unsupervised learning: model discovers patterns and structure in unlabeled data (clustering, dimensionality reduction).
- Choose supervised methods when labeled data and specific prediction goals are available; choose unsupervised methods when you want to explore data structure or segment data without labels.
Further reading
- MNIST dataset — http://yann.lecun.com/exdb/mnist/
- ImageNet — http://www.image-net.org/
- scikit-learn clustering and dimensionality reduction — https://scikit-learn.org/stable/modules/clustering.html