15/10/26 Thu 8:05am

K- Means Clustering

Is an unsupervised learning algorithm that divides the observations into k groups based on similarity. Observations within a group are close to one another in the selected feature space.

Steps for k-means clustering algorithm.

  1. Select the number of clusters
  2. Choose the initial centroids of the cluster
  3. Calculate each observation distance from every centroid
  4. Assign each observation to its nearest centroid/cluster
  5. Recalculate each centroid
  6. Repeat Step Three to Five until the maximum iteration count is reached

where the centroid is given by:

QnA

Q1

Question

A pump generates two features without labels, the observations for the historical data are as given below
Divide these features into two clusters with initial centroids as (1,1) and (3,1)

Flow FeaturePressure Feature
P111✅
P213
P331✅
P477
P579
P697
Soln
Distance to (1,1)Distance to (3,1)
P2 (1,3)22.8284
P4 (7,7)8.48527.211
P5 (7,9)108.9442
P6 (9,7)108.4852
venn-beta
  title Cluster
  set A[P1,P2]
  set B[P3,P4,P5,P6]

The new centroids are