Skip to content

Task Types

Clustering (ML Task)

In shortAn unsupervised ML task that groups unlabelled data, such as keywords, pages or customers, by similarity so patterns emerge without predefined categories.

Updated 24 Oct 2026· 2 min read

Clustering is the machine learning task of splitting an unlabelled dataset into groups of similar items. It is unsupervised: you do not tell the model what the groups should be, it finds them from the data. If classification is the task where you bring the categories, clustering is the one where you let the data suggest them.

How it works

The algorithm measures how similar data points are, using metrics such as Euclidean distance or cosine similarity, then groups the closest ones. Text first has to become numbers, through TF-IDF vectors or embeddings, before any clustering can happen. Algorithms differ in two main ways:

Because there are no labels, quality is judged by reading the clusters, by metrics such as the silhouette score, and by iterating on the number of clusters and the features.

How it’s used in SEO and marketing

  • Topic modelling of site content, reviews or transcripts with LDA or BERTopic.
  • Keyword clustering and keyword-to-topic mapping to plan silos and hubs.
  • Customer segmentation on CRM and GA4 data with K-means or Gaussian mixture models.
  • Image clustering by colour or style for ecommerce categorisation.
  • Competitor analysis, grouping domains by traffic, links and keyword footprint.
  • Anomaly detection, where density-based methods flag points that fit no cluster, such as odd traffic spikes or spammy links.

Example

You export 3,000 ranked keywords for a fashion retailer and embed them. Clustering groups them into themes such as summer clothes, maternity and festival wear without anyone defining those themes. Sized by search volume in a treemap, the clusters become a readable map of the market and a draft site structure.

Limitations and things to watch

  • Clusters have no names; you or a labelling method such as c-TF-IDF must interpret them.
  • Results depend heavily on preprocessing, the embedding model and settings such as the number of clusters.
  • Some algorithms force every point into a cluster, which hides genuine outliers.
  • Treat clustering as exploration. Expect to run it several times before the output is useful.

Clustering also matters in AI search: query fan-out splits one question into sub-topics, and content that maps onto coherent, well-covered clusters is easier to recognise as the source for each one.

Learn it on MLforSEO

Where Clustering (ML Task) shows up on MLforSEO

Sources and further reading

Other terms from Task Types

See all 13 Task Types terms →