166k views
1 vote
we apply k-means clustering to the following data, assuming k=2 and points a and c are randomly selected as the inital means of the two clusters. the choice of distance is euclidean distance. A(1,1) B(1,0) C (0,2) D(2,4) E(3,5) what are the centriods of the two inital clusters

User Dan Sharp
by
7.2k points

1 Answer

5 votes

The centroids for the two clusters are (0.5, 1) and (2, 3)

How to determine the centriods of the two inital clusters

From the question, we have the following parameters that can be used in our computation:

A(1,1) B(1,0) C (0,2) D(2,4) E(3,5)

Start by calculating the Euclidean distance using


\text{d(x, y)} = \sqrt{\sum\limits^n_(i=1) {(x_i - y_i)^2}

Using point A as a reference, we have the following:

AA = √[(1 - 1)² + (0 - 0)²] = 0

AB = √[(1 - 1)² + (1 - 0)²] = 1

AC = √[(1 - 0)² + (1 - 2)²] = √2

AD = √[(1 - 2)² + (1 - 4)²] = √10

AE = √[(1 - 3)² + (1 - 5)²] = √20

Using point C as a reference, we have the following:

CA = √[(1 - 0)² + (1 - 2)²] = √2

CB = √[(0 - 1)² + (2 - 0)²] = √5

CC = √[(0 - 0)² + (2 - 2)²] = 0

CD = √[(0 - 2)² + (2 - 4)²] = √8

CE = √[(2 - 3)² + (4 - 5)²] = √2

Assigning each point to the cluster with the nearest centroid, we have

Cluster 1 (associated with A): B(1,0) and C(0,2)

Cluster 2 (associated with C): A(1,1) and E(3,5)

Next, we the new centroids based on the mean of the points in each cluster.

New centroid for Cluster 1 (A) = 1/2(1 + 0, 0 + 2)

A = (0.5, 1)

New centroid for Cluster 2 (C) = 1/2(1 + 3, 1 + 5)

C = (2, 3)

Hence, the centroids for the two clusters are (0.5, 1) and (2, 3)

User DrowsyTicker
by
7.8k points