What is the difference between supervised learning and unsupervised learning?
Answer
Supervised learning trains on labeled data (every example comes with a target output) and learns a mapping that predicts the label of new, unseen inputs. Unsupervised learning works on unlabeled data and instead discovers hidden structure in the inputs themselves, such as clusters or low-dimensional representations. The practical difference is the supervision signal: supervised models are corrected against known answers during training, while unsupervised models optimize an intrinsic objective like reconstruction error or cluster compactness. Supervised learning covers classification and regression; unsupervised learning covers clustering and dimensionality reduction.
(1) Data Requirement: Supervised needs input–label pairs ; unsupervised needs only inputs
, which are far cheaper to collect.
(2) Learning Objective: Supervised minimizes prediction error against the labels; unsupervised optimizes structure objectives such as cluster compactness or reconstruction loss.
(3) Typical Tasks: Classification and regression for supervised; clustering, dimensionality reduction, and density estimation for unsupervised.

Figure 1: The supervision signal is the dividing line: supervised training compares predictions with labels, unsupervised training exploits structure in the inputs alone.
Mathematical Formulation:
Where:
is the supervised model with parameters
, mapping input
to a predicted label
.
is the per-example supervised loss (e.g., cross-entropy or squared error), and
indexes the
labeled examples.
is the
-th cluster of a
-means objective and
its centroid; there are no labels
anywhere in the unsupervised objective.

Figure 2: Left: labeled points let a supervised model fit a decision boundary. Right: without labels, an unsupervised model can only group points by similarity.
| Aspect | Supervised Learning | Unsupervised Learning |
|---|---|---|
| Training data | Labeled pairs | Unlabeled inputs |
| Goal | Predict outputs for new inputs | Discover hidden patterns or structure |
| Typical tasks | Classification, regression | Clustering, dimensionality reduction |
| Feedback signal | Direct error against known labels | Intrinsic objective (compactness, reconstruction) |
Leave a Reply