Unsupervised learning

On this page 7

Unsupervised learning is the branch of machine learning in which a model discovers structure in data without labeled targets. Instead of learning a mapping from inputs to known answers, it groups similar examples, compresses data into fewer dimensions, estimates how the data is distributed or flags observations that do not fit. Among the AI fundamentals of artificial intelligence, it stands beside supervised learning and reinforcement learning as one of the three classic learning paradigms.

Its appeal is practical: unlabeled data is abundant and cheap, while labels are scarce and expensive. Its difficulty is equally practical: without a ground truth, judging whether the discovered structure is meaningful requires domain knowledge and careful evaluation.

How unsupervised learning finds structure

Every unsupervised method optimizes an objective defined on the data alone. Clustering minimizes distances within groups, dimensionality reduction preserves variance or neighborhoods, density estimation maximizes the likelihood of the observed points, and autoencoders minimize reconstruction error after squeezing inputs through a narrow representation.

Because the objective comes from the data rather than from labels, the choices of features, scaling and distance metric define what counts as similar. Two analysts can run the same algorithm on the same records and obtain different clusters simply by standardizing variables differently. This sensitivity is the defining characteristic of the paradigm, and it is why preprocessing receives as much attention as the algorithm itself.

Main task families and algorithms

Unsupervised learning covers several task families, each answering a different question about the data. The table lists the core families with representative algorithms and their typical outputs.

Task familyQuestion answeredRepresentative algorithmsTypical output
ClusteringWhich records belong togetherk-means, DBSCAN, hierarchical clusteringGroup assignment per record
Dimensionality reductionWhich few factors explain the dataPCA, t-SNE, UMAPLow-dimensional coordinates
Density estimationHow likely is each observationGaussian mixture models, kernel densityProbability or likelihood score
Anomaly detectionWhich records are unusualIsolation forest, one-class SVMOutlier score
Association rulesWhich items occur togetherApriori, FP-growthRules with support and confidence
Representation learningWhat compact encoding captures the dataAutoencoders, variational autoencodersEmbedding vectors
Task families in unsupervised learning

Several algorithms need a structural parameter chosen in advance. k-means needs the number of clusters k, DBSCAN needs a neighborhood radius and a minimum point count, and PCA needs the number of components, often chosen so that the components explain 80 to 95 percent of the variance.

How it differs from neighboring paradigms

The boundaries between learning paradigms are defined by where the training signal comes from. That distinction matters because modern systems frequently combine several paradigms in one pipeline.

ParadigmSource of the signalTypical goalExample
Supervised learningHuman-provided labelsPredict a known targetSpam classification
Unsupervised learningStructure of the data itselfDescribe or compress the dataCustomer segmentation
Semi-supervised learningFew labels plus many unlabeled recordsPredict with scarce labelsMedical image tagging
Self-supervised learningLabels generated from the dataLearn general representationsNext-token prediction
Reinforcement learningRewards from an environmentChoose actions over timeGame playing
Learning paradigms by source of the training signal

Self-supervised learning is sometimes described as a form of unsupervised learning because no human labels are involved. The more precise view is that it creates supervised-style prediction tasks from raw data, such as predicting a masked word, and it is the main pretraining method behind today’s foundation models. Classic unsupervised learning, by contrast, has no prediction target at all.

Evaluating results without labels

Evaluation is the hardest part of unsupervised learning because there is no correct answer to compare against. Practitioners combine internal metrics, stability checks and external validation by domain experts.

ApproachWhat it measuresLimitation
Silhouette scoreCohesion versus separation, from -1 to 1Favors compact, spherical clusters
Elbow methodDrop in within-cluster variance as k growsThe elbow is often ambiguous
Explained varianceShare of variance kept by componentsSays nothing about usefulness
Stability under resamplingWhether structure survives data perturbationStable structure can still be trivial
Downstream task performanceGain when outputs feed a supervised modelRequires some labeled data
Expert reviewWhether groups make business or scientific senseSubjective and slow
Common evaluation approaches

The decisive recommendation is to judge results by their usefulness for a decision, not by an internal score alone. A segmentation with a modest silhouette score that marketing teams can act on is more valuable than a mathematically crisp one that splits customers along an irrelevant variable.

Limitations and common mistakes

Unsupervised methods always return an answer, which makes them easy to misuse. k-means will produce k clusters even when the data has no cluster structure at all, and a dimensionality reduction plot will show shapes even in random noise.

  • Skipping feature scaling, which lets variables with large units, such as income in currency, dominate distance calculations.
  • Reading t-SNE or UMAP plots as exact maps, although distances between distant groups and cluster sizes in these plots are not reliable.
  • Assuming clusters are real categories rather than a convenient partition of a continuous distribution.
  • Ignoring the curse of dimensionality, where distances between points become nearly equal in very high-dimensional spaces.
  • Treating anomalies as errors without investigation, although unusual records are often the most valuable ones.

The simple explanation

Imagine emptying a large box of mixed buttons onto a table without any instructions. You would probably start sorting them by color, size or number of holes. Nobody told you the categories; you found the groups by looking at the buttons themselves.

Unsupervised learning does the same with data. A computer receives many records without answers attached and looks for natural groups, patterns and oddities. People then decide whether those groups are useful.

How it is used in practice

An online retailer with about two million customers wants to tailor its email campaigns but has no predefined customer types. Its analysts compute features for each customer, such as purchase frequency, average basket value, days since the last order and the share of discounted purchases, and they standardize every feature before modeling.

They run k-means for k between 3 and 10, compare silhouette scores and stability across resamples, and settle on six segments that marketing staff can describe in plain words, including bargain hunters, loyal high spenders and lapsing customers. An isolation forest on the same features also surfaces a small group of accounts with abnormal order patterns, which the fraud team reviews. The outcome is targeted campaigns built from structure the data revealed, not from assumptions.