To determine the optimal number of clusters in K-Means using Elbow and Silhouette methods
Elbow Method
- Enter the values of X and Y in the attributes section and click on the ADD button.
- Repeat step 1 until there are 5 data-points in the table.
- Click on the NEXT button.
- Select centroids and click on the SUBMIT button.
- Find the Euclidean distance between a centroid and a data point by clicking on the DISTANCE button.
- Click on the CLUSTER button to determine the cluster of each data point.
- Click on the CENTROIDS button and compute the new centroid of each cluster.
- Repeat steps 4 to 7 until the Old Cluster value and New Cluster value match.
- If the Old Cluster matches the New Cluster, click on the NEXT button and enter the required value in the SSE equation.
- After finding total SSE click on the NEXT button and repeat steps 4 to 9 for K = 2 to 4.
- Finally, click on the PLOT button to display the graph.
Silhouette method
- Enter the values of X and Y in the attributes section and click on the ADD button.
- Repeat step 1 until there are 5 data-points in the table.
- Click on the NEXT button.
- Select centroids and click on the SUBMIT button.
- Find the Euclidean distance between a centroid and a data point by clicking on the DISTANCE button.
- Click on the CLUSTER button to determine the cluster of each data point.
- Click on the CENTROIDS button and compute the new centroid of each cluster.
- Repeat steps 4 to 7 until the Old Cluster value and New Cluster value match.
- If the Old Cluster matches the New Cluster, click on the NEXT button and then click on COHESION.
- Next, click on the SEPARATION button.
- Enter the values for a(i) and b(i) into the Silhouette coefficient equation from the table, and then click on the SUBMIT button.
- Now, calculate the average Silhouette score by entering all individual Silhouette scores (s(i)) into the equation, and then click on the SUBMIT button.
- Click on the NEXT button.
- Repeat steps 4 to 13 for K = 3, 4, 5.
- Finally, click on the PLOT button to display the graph.