How to use it
- Enter the points: the coordinates of each point separated by spaces or commas, and the points separated by semicolons (any number of dimensions, the same for all points).
- Enter one cluster label per point, in the same order — letters, numbers or words.
- Read the silhouette score, its interpretation, the mean of each cluster and the first 20 point values.
How it works
For every point i, with Euclidean distances:
- a(i) = mean distance from i to the other points of its own cluster;
- b(i) = for each other cluster, the mean distance from i to its points — take the smallest;
- s(i) = (b(i) − a(i)) ÷ max(a(i), b(i)), and s(i) = 0 if i is alone in its cluster.
The silhouette score is the mean of s(i) over all points, as scikit-learn’s silhouette_score computes it.
Worked example
Six points in two groups: A = (1, 2), (2, 1), (2, 3) and B = (8, 8), (9, 7), (9, 9).
For the point (1, 2):
- a = mean distance to (2, 1) and (2, 3) = (√2 + √2) ÷ 2 = 1.4142;
- b = mean distance to cluster B = (√85 + √89 + √113) ÷ 3 = 9.7612;
- s = (9.7612 − 1.4142) ÷ 9.7612 = 0.8551.
Doing the same for every point gives cluster means A: 0.8249 and B: 0.8262, and a silhouette score of 0.8256 — a strong structure.
Tips
- Scale your features first. Distances mix all coordinates, so a feature measured in thousands drowns one measured in fractions.
- The silhouette favours round, even clusters. For long or nested shapes found by DBSCAN, a low score does not always mean a bad clustering.
- To compare two points directly, use the Manhattan and Euclidean distance calculator.