What is AI clustering?
Clustering is the unsupervised learning task of revealing natural structure in data by placing similar records in the same group and dissimilar ones in separate groups, without labelled data.
It is also called cluster analysis. It differs from classification in labels: classification assigns predefined categories, while clustering finds groups from the data and does not name them. Anomaly detection, by contrast, looks for records that fit no group.
- Topic
- Machine learning, models and training
- Also known as
- Cluster analysis
- Origin
- 1957 (published 1982), the basis of k-means; named in 1967
How AI clustering works
- Records become numeric features or, for text and documents, embedding vectors; distance or cosine similarity is chosen as the similarity measure.
- In centroid methods such as k-means a preset number of centres is chosen; each record joins its nearest centre and centres update iteratively.
- Density-based methods treat dense regions as clusters and leave sparse points as noise; hierarchical methods merge clusters into a tree.
- Cluster count and quality are tested with measures such as the silhouette score; people interpret what clusters mean.
In more detail
The curse of dimensionality, scaling and dimensionality reduction
Euclidean distance loses discriminative power in high-dimensional spaces, such as 768- or 1,536-dimensional text embeddings, a phenomenon known as the curse of dimensionality. In addition, tabular features on different scales (e.g., income versus age) should be standardised before clustering and modern text-clustering pipelines (such as BERTopic) typically apply dimensionality reduction like UMAP or PCA before running HDBSCAN.
Method assumptions and soft clustering
Centroid methods like k-means implicitly assume roughly spherical, similarly sized clusters and struggle with elongated shapes or outliers. Density-based algorithms such as DBSCAN and HDBSCAN handle arbitrary shapes and label outliers as noise, while Gaussian Mixture Models (GMMs) provide soft probabilistic memberships when records sit between clusters.
Evaluation limits and automatic cluster labelling
Silhouette scores reward compact, convex clusters and can unfairly penalise valid density-based clusters of irregular shape. They also scale quadratically with dataset size, so large enterprise workloads rely on subsampling, Calinski-Harabasz or Davies-Bouldin indices or density-based cluster validation (DBCV) alongside LLM-assisted cluster labelling.
Commonly confused terms
| Term | How it differs |
|---|---|
| Topic modelling | Topic modelling (e.g., LDA or BERTopic) discovers latent themes in text and often allows a document to belong to multiple topics (soft mixture), whereas standard clustering like k-means typically assigns each record to a single hard cluster (though BERTopic combines embeddings, UMAP and HDBSCAN clustering). |
Why AI clustering matters for on-premises AI
Organisations use clustering for customer segmentation, finding groups of similar complaints or documents and exploring large text piles; needing no labels, it is the first step in understanding a new dataset. Vector indexes such as IVF also cluster vectors and search only the relevant clusters to speed up retrieval. Results are exploratory; a domain expert validates clusters before they become decision rules.
A telecom operator clusters the embedding vectors of a month of customer complaints; among the resulting groups a cluster tied to an unexpected billing error stands out and goes to the responsible team.
Common questions
What is the difference between clustering and classification?
Classification assigns predefined categories using labelled data. Clustering groups similar records without labels; people interpret the groups afterwards.
How is the number of clusters chosen?
In methods such as k-means several values are tried and compared with measures such as the silhouette score. Density-based methods find the count themselves.
Related terms
- Unsupervised learning
- Anomaly detection
- Classification
- Cosine similarity
- Embedding
- Topic modelling
- Inverted File Index
Sources
In the glossary: Glossary, A to D