To determine the optimal number of clusters in K-Means using Elbow and Silhouette methods

Elbow Method

  1. Enter the values of X and Y in the attributes section and click on the ADD button.
  2. Repeat step 1 until there are 5 data-points in the table.
  3. Click on the NEXT button.
  4. Select centroids and click on the SUBMIT button.
  5. Find the Euclidean distance between a centroid and a data point by clicking on the DISTANCE button.
  6. Click on the CLUSTER button to determine the cluster of each data point.
  7. Click on the CENTROIDS button and compute the new centroid of each cluster.
  8. Repeat steps 4 to 7 until the Old Cluster value and New Cluster value match.
  9. If the Old Cluster matches the New Cluster, click on the NEXT button and enter the required value in the SSE equation.
  10. After finding total SSE click on the NEXT button and repeat steps 4 to 9 for K = 2 to 4.
  11. Finally, click on the PLOT button to display the graph.

Silhouette method

  1. Enter the values of X and Y in the attributes section and click on the ADD button.
  2. Repeat step 1 until there are 5 data-points in the table.
  3. Click on the NEXT button.
  4. Select centroids and click on the SUBMIT button.
  5. Find the Euclidean distance between a centroid and a data point by clicking on the DISTANCE button.
  6. Click on the CLUSTER button to determine the cluster of each data point.
  7. Click on the CENTROIDS button and compute the new centroid of each cluster.
  8. Repeat steps 4 to 7 until the Old Cluster value and New Cluster value match.
  9. If the Old Cluster matches the New Cluster, click on the NEXT button and then click on COHESION.
  10. Next, click on the SEPARATION button.
  11. Enter the values for a(i) and b(i) into the Silhouette coefficient equation from the table, and then click on the SUBMIT button.
  12. Now, calculate the average Silhouette score by entering all individual Silhouette scores (s(i)) into the equation, and then click on the SUBMIT button.
  13. Click on the NEXT button.
  14. Repeat steps 4 to 13 for K = 3, 4, 5.
  15. Finally, click on the PLOT button to display the graph.