How is the silhouette coefficient for an individual data point calculated?
Last updated
Compute a(i), the mean distance from point i to the rest of its own cluster, and b(i), the smallest mean distance from i to any other cluster.
s(i) = (b − a) / max(a, b), which always lies in [−1, 1]. For example, a = 2 and b = 8 gives 0.75.
s(i) = 0 for a singleton cluster. The cost is O(n²).
silhouette_samplesgives per-point values andsilhouette_scoregives their mean.