Unsupervised Learning

Unsupervised learning works on data without labels, discovering groups, compact representations and outliers. This landing page introduces the three main families and links to the detailed pages for each algorithm.


1. What Unsupervised Learning Is

Supervised vs Unsupervised Learning Data (X, y) features + labels Learn f: X -> y minimize loss vs y Predictions classes / values Data X only no labels Find structure density, geometry Clusters, axes, outlier scores Supervised Unsupervised No ground truth means evaluation relies on internal metrics, stability, and downstream usefulness.

Unsupervised learning finds structure in data that has no target column. Instead of learning a mapping to known labels as in supervised learning, the algorithm models the data distribution itself: which points group together, which directions carry the variance, which points do not fit. Because there is no ground truth, the hard part is usually not fitting the model but deciding whether the result is meaningful.

2. Topics in This Section

The Three Families Covered Here Unlabeled data X Clustering group similar points K-Means, DBSCAN, HAC Dimensionality Reduction compress features PCA, t-SNE, UMAP Anomaly Detection score the odd ones IForest, LOF, AE

Clustering

Group similar points: centroid, density and hierarchical approaches, and how to evaluate clusters without labels.

Dimensionality Reduction

Compress many features into a few: PCA for linear structure, t-SNE and UMAP for visualization.

Anomaly Detection

Score rare, unusual points with Isolation Forest, LOF, One-Class SVM and reconstruction error.

K-Means

Fast centroid clustering with Lloyd's algorithm and k-means++.

DBSCAN

Density clustering that finds arbitrary shapes and labels noise.

PCA

Orthogonal axes of maximum variance via the SVD.

3. Workflow and Evaluation

A Typical Unsupervised Workflow Clean + scale impute, standardize Reduce PCA / UMAP Cluster or score fit model Validate silhouette, stability Interpret profile segments Iterate: scaling and feature choice change the answer more than the algorithm does.

Unsupervised methods also feed supervised ones: cluster IDs and PCA components become features, and self-supervised pretraining (see semi- / self-supervised learning) is how modern embedding and language models learn from unlabeled data.

4. Choosing a Method

Choosing an Unsupervised Method Question What do I want from unlabeled data? Groups? K-Means, GMM, DBSCAN / HDBSCAN, hierarchical Fewer dims? PCA (linear), UMAP / t-SNE (visualization) Outliers? Isolation Forest, LOF, autoencoder reconstruction

Start from the question, not the algorithm. If the goal is segmentation (customer groups, document topics, cell types), use clustering. K-Means is the fast baseline when clusters are roughly spherical and similar in size; Gaussian mixture models give soft assignments and elliptical shapes; DBSCAN and HDBSCAN find arbitrary shapes and leave noise unassigned; hierarchical clustering produces a dendrogram you can cut at any level.

If the goal is compression or visualization, use dimensionality reduction. PCA is linear, fast, invertible and suitable as a preprocessing step. t-SNE and UMAP are non-linear and mainly for 2-D plots; distances and cluster sizes in their output should not be read literally.

If the goal is finding the unusual, use anomaly detection. Isolation Forest is a strong tabular default; Local Outlier Factor handles local density differences; autoencoders score reconstruction error on images, logs and sensor data.

FamilyTypical outputMain knobCommon trap
Centroid clusteringOne label per pointNumber of clusters kForces every point, including outliers, into a cluster
Density clusteringLabels plus noiseeps / min_cluster_sizeBreaks down in high dimensions
Linear reductionComponents, explained varianceNumber of componentsMisses curved structure
Manifold embedding2-D or 3-D coordinatesPerplexity / n_neighborsReading meaning into gaps and distances
Anomaly scoringScore per pointContamination / thresholdNo labels to calibrate the threshold

5. A Practical Pipeline

Most real projects follow the same shape. Clean and encode the data, then scale it, because nearly every method here measures distance or variance and a feature in dollars will otherwise drown a feature in percentages. For wide data (hundreds of columns or raw text and images), reduce first: PCA to a few dozen components, or a pretrained embedding model for text and images (see vector embeddings). Then fit the clustering or anomaly model on that compact representation.

Validation has three layers. Internal metrics such as silhouette score compare within-cluster to between-cluster distance, but they favour the convex shapes that K-Means already assumes, so a high silhouette does not prove a density-based result is wrong or vice versa. Stability checks whether the same structure appears across bootstrap samples, random seeds and nearby parameter values; the adjusted Rand index between runs is a convenient summary. External review is the decisive layer: show cluster exemplars to domain experts, or measure whether the segments or anomaly flags improve a downstream decision.

6. Use Cases and Pitfalls

Common production uses include customer and product segmentation, grouping support tickets or documents by topic (embedding plus UMAP plus HDBSCAN, the approach behind BERTopic), deduplicating near-identical records, fraud and intrusion detection, sensor fault detection, compressing features before a supervised model, and pretraining representations that are later fine-tuned with a few labels (self-supervised learning).

Further reading: Hastie, Tibshirani & Friedman, The Elements of Statistical Learning (2009), chapter 14; Jain, "Data Clustering: 50 Years Beyond K-Means" (2010); the scikit-learn user guide sections on clustering and decomposition.

Machine Learning (ML)Sectionsection home Supervised LearningSectionlearning from labels Semi- / Self-Supervised Learningmachine learningusing unlabeled data to help with few labels AutoencodersSectionneural compression and anomaly scoring