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.
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.
Group similar points: centroid, density and hierarchical approaches, and how to evaluate clusters without labels.
Compress many features into a few: PCA for linear structure, t-SNE and UMAP for visualization.
Score rare, unusual points with Isolation Forest, LOF, One-Class SVM and reconstruction error.
Fast centroid clustering with Lloyd's algorithm and k-means++.
Density clustering that finds arbitrary shapes and labels noise.
Orthogonal axes of maximum variance via the SVD.
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.
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.
| Family | Typical output | Main knob | Common trap |
|---|---|---|---|
| Centroid clustering | One label per point | Number of clusters k | Forces every point, including outliers, into a cluster |
| Density clustering | Labels plus noise | eps / min_cluster_size | Breaks down in high dimensions |
| Linear reduction | Components, explained variance | Number of components | Misses curved structure |
| Manifold embedding | 2-D or 3-D coordinates | Perplexity / n_neighbors | Reading meaning into gaps and distances |
| Anomaly scoring | Score per point | Contamination / threshold | No labels to calibrate the threshold |
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.
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).
k clusters. Compare against a shuffled or random baseline.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.