KNIME logo
DownloadTalk to Sales
Read time: 7 min

Cluster Analysis: What It Is, the Types, and How to Apply It

How k-means, hierarchical, and DBSCAN clustering surface groups in your data never labeled, from supplier risk tiers to fraud rings

October 22, 2026
Put simply
clustering-analysis-hero
Stacked TrianglesPanel BG

A supply chain planner doesn't walk in with a pre-built list of “supplier types.” But group hundreds of suppliers by spend, lead time, and defect history, and natural groupings emerge that nobody labeled in advance: a handful of high-risk suppliers nobody had flagged, and a cluster of consistently reliable ones worth consolidating orders with.

That's clustering: finding structure in data when the categories aren't already known. Classification is the mirror case: the categories are defined in advance, and the model just sorts data into them. Clustering is an unsupervised machine learning technique that groups similar data points based on their characteristics. The resulting groups, called clusters, represent patterns or structures in the data that may not be immediately obvious.

Clustering is commonly used for data exploration, visualization, prototyping, sampling, and segmentation, and it can produce a single cluster or multiple distinct clusters depending on the data and method used.

With recent advances in AI, business experts can now apply clustering themselves, directly, without waiting on a data science team.

Cluster analysis - what it is and how to apply it without code
A scatter plot of the example data, with different clusters denoted by different colors

Types of clustering algorithms

There are many clustering algorithms available, each based on different assumptions about how data should be grouped. In this article, we focus on three commonly used methods:

  1. k-means: groups data into a predefined number of clusters based on similarity
  2. Hierarchical: builds a hierarchy by iteratively merging or splitting clusters
  3. DBSCAN: a density-based method that identifies clusters of arbitrary shape and isolates noise

Depending on the algorithm used, the resulting clusters can have very different characteristics, such as shape, size, and density. Clusters may form a hierarchy (for example, when cluster C results from merging clusters A and B), or they may be disjoint, touching, or overlapping.

Cluster analysis - what it is and how to apply it without code
Clusters with different characteristics

Although each algorithm follows a distinct approach, they can sometimes produce similar results. For instance, when data naturally form well-separated, spherical clusters, both k-means and hierarchical clustering may identify nearly identical groupings.

Let's take a closer look at how different clustering algorithms produce clusters with different properties.

1. k-Means clustering

K-means clustering is one of the most widely used clustering algorithms. It is a partitioning method that divides the data space into a predefined number of clusters, K. Unlike classification, these clusters do not correspond to known target classes but are discovered directly from the data. A supply chain planner who already knows they want to sort suppliers into, say, three risk tiers would reach for k-means: decide on K upfront, and the algorithm finds the best way to split the data into that many groups.

The algorithm begins by randomly selecting K initial cluster centers (see below, left). Each data point is then assigned to the nearest center (see below, right). Once all points are assigned, the cluster centers are recalculated as the centroids of their respective clusters.

Cluster analysis - what it is and how to apply it without code
Randomly selected K cluster centers (left) and resulting clusters (right).

This process, assigning points to the nearest center and recalculating centroids, is repeated until the cluster centers no longer change significantly (see below).

Cluster centers are iteratively recalculated until they stop moving.
Cluster centers are iteratively recalculated until they stop moving.

k-means performs best when clusters are compact, roughly spherical, and similar in size. Because the algorithm minimizes the distance between data points and their assigned centroids, it struggles with clusters that have complex shapes or varying densities.

k-means is also sensitive to outliers, which can disproportionately influence centroid positions and reduce clustering quality. For this reason, it is often important to identify and handle outliers before applying the algorithm. Common approaches include removing extreme values, assigning them to a separate cluster, or applying transformations that reduce their influence on distance calculations.

2. Hierarchical clustering

Hierarchical clustering builds clusters by iteratively grouping the closest data points or clusters, forming a hierarchy of increasingly larger clusters. In the beginning, each data point is treated as its own cluster. At each step, the two closest clusters are merged, and this process continues until all data points are combined into a single cluster.

The result is a hierarchy of clusters, which is typically visualized using a dendrogram (see below, left).

A dendrogram shows how data points and clusters are merged at different distances, starting with individual data points at the bottom and ending with one large cluster at the top.

 Hierarchical clustering
A dendrogram (left) resulting from hierarchical clustering. As the distance cut-off is raised, larger clusters are formed. Clusters are denoted in different colors in the scatter plot (right), as well as in the dendrogram.

To extract a specific clustering result, a distance cut-off can be applied to the dendrogram. Cutting the dendrogram at a chosen height yields a corresponding number of clusters (see below). This makes hierarchical clustering especially useful for exploratory analysis: a supply chain planner can cut the dendrogram high for a handful of broad supplier risk tiers, or cut it low to see the finer sub-groups inside each tier, all from the same clustering run. The shape and separation of clusters produced by hierarchical clustering depend on how distances between clusters are defined, which is determined by the linkage method.

Cluster analysis - what it is and how to apply it without code
Six clusters are formed at the cut-off threshold of 1.0.

Types of linkage methods in hierarchical clustering

Hierarchical clustering commonly uses one of the following linkage methods:

  • Single linkage measures the distance between the closest pair of points in two clusters. This method can identify elongated or irregularly shaped clusters, but is prone to forming “chains” of loosely connected points.
  • Complete linkage defines the distance between clusters as the distance between their farthest points. This approach tends to produce compact and evenly sized clusters, but may split larger natural groups.
  • Average linkage calculates the distance between clusters as the average distance between all pairs of points across clusters. This method represents a compromise between single and complete linkage and often provides balanced results.

3. DBSCAN

DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a density-based clustering algorithm that groups data points located in dense regions of the data space. Points that lie in low-density regions are not assigned to any cluster and are instead treated as noise.

The algorithm begins by examining a data point and identifying its local neighborhood, defined by a distance threshold (ε). If the number of points within this neighborhood exceeds a minimum threshold (minPts), the point is considered a core point, and a new cluster is formed. Neighboring points that also meet the density criterion are added to the cluster, and their neighborhoods are examined in turn.

This expansion process continues until no more points can be added to the cluster. DBSCAN then moves on to examine remaining unvisited points, forming additional clusters where density conditions are met, until all points have been processed (see below).

The cluster formation process with the DBSCAN algorithm.
The cluster formation process with the DBSCAN algorithm.

Data points that do not belong to any dense region are labeled as noise. Because DBSCAN relies on local point density rather than distance to a centroid, it can identify clusters of arbitrary shape and is robust to outliers (see below). A financial analyst screening transactions for coordinated fraud can use this property directly: DBSCAN surfaces the dense clusters of related suspicious activity worth investigating, and flags a single odd transaction as noise when it doesn't fit any pattern.

Cluster analysis - what it is and how to apply it without code
Examples of clusters formed by DBSCAN

How to choose a clustering algorithm

As demonstrated above, different clustering algorithms produce different types of clusters. There is no single method that works well for all data structures or clustering goals. The choice of algorithm depends on factors such as cluster shape, size, density, presence of noise, and interpretability requirements.

Selecting an appropriate clustering method can significantly improve how well patterns in the data are revealed. For example, hierarchical clustering produces a nested structure of clusters, which is especially useful for a financial analyst auditing transaction patterns: broad clusters show major behavioral groups, while drilling down reveals the specific sub-patterns worth a closer look.

Once a cluster analysis has been performed, similar data points within a cluster can be summarized using a cluster representative, reducing the size and complexity of the dataset. This enables data reduction, improves computational efficiency, and supports clearer visualization. Clustering can also help identify unusual observations, such as outliers or noise, that behave differently from the majority of the data.

How to apply clustering algorithms in Knime

A cluster label like “high-risk supplier” or “likely fraud ring” only holds up if someone can trace it back to the data and the method that produced it. A label nobody can explain is just a guess with better branding.

With Knime, you can run a full cluster analysis, alongside any other machine learning or data analytics task.

Build clustering workflows visually, on Knime's drag-and-drop canvas, and share them across your team exactly as built, so a colleague can open one later and follow the same steps you did. Workflows save and reuse across teams, supporting both rapid prototyping and repeatable analysis. When you need more control, Knime also supports scripting languages directly on the same canvas, so you're never locked out of a more advanced approach.

How to apply clustering algorithms without code
An example workflow of clustering on simulated clustered data, implementing three clustering algorithms.

Knime supports a wide range of clustering algorithms, so you can choose the method that fits your data and your goals. Above is an example of a Knime workflow that implements the three clustering algorithms discussed in this article using simulated data.

Continue exploring:

You might also like