WCSS
Within-cluster sum of squares (WCSS) is a measure used in cluster analysis to quantify the compactness of clusters produced by partitioning algorithms such as k-means. It is defined as the sum, over all clusters, of the squared distances between each data point and the centroid of the cluster to which it belongs. For a dataset partitioned into K clusters with centroids μ1, μ2, ..., μK, WCSS = sum_{j=1}^K sum_{x_i in C_j} ||x_i − μ_j||^2, where ||·|| denotes the Euclidean norm. In many software packages, this quantity is called inertia.
WCSS serves as a criterion for evaluating clustering quality: lower values indicate more compact clusters. It
Key considerations include its dependence on the scale and distribution of the data. Since WCSS uses squared