# Hierarchical Clustering using Centroids

Perform a hierarchical clustering (with five clusters) of the one-dimensional set of points $2, 3, 5, 7, 11, 13, 17, 19, 23$ assuming clusters are represented by their centroid (average) and at each step the clusters with the closest centroids are merged.

I begin with every point in its own cluster, i.e. $\left\{2\right\},\left\{3\right\},\left\{5\right\},\left\{7\right\},\left\{11\right\},\left\{13\right\},\left\{17\right\},\left\{19\right\},\left\{23\right\}$ I then know that the distance between any 2 clusters is the Euclidean distance between their centroids and we merge the 2 clusters at the shortest distance. However Im not sure how to calculate the centroids.

The cluster centroid $c$ of a cluater $C = \{v_1, v_2, \cdots, v_{|C|}\}$ is usually defined as $$c = \frac{1}{|C|} \sum_{i=1}^{|C|} v_i$$ That is, it is the mean of the points.
• So would the final answer be: $\left\{2,3\right\}, \left\{5,7\right\}, \left\{11,13\right\}, \left\{17,19\right\}, \left\{23\right\}$? This seems too simple as it is found after 1 step – Sophie Filer Apr 28 '17 at 16:09