compute_tightness function

Compute dispersion of a single cluster

Compute dispersion of a single cluster

compute_tightness(dists, cluster)

Arguments

  • dists: A distance matrix for points in the cluster.
  • cluster: A list containing named vectors, whose names are data point names and whose values are cluster labels

Returns

A real number in [0,1][0,1] representing a measure of dispersion of a cluster.

Details

This method computes a measure of cluster dispersion. It finds the medoid of the input data set and returns the average distance to the medoid. Formally, we say the tightness τ\tau of a cluster CC is given by

τ(C)=1(C1)idist(xi,xj) \tau(C) = \dfrac{1}{\left(|C|-1\right)}\displaystyle\sum_{i}\text{dist}(x_i, x_j)

where

xj=argminxjCxiC,ijdist(xi,xj) x_j = \text{arg}\,\min\limits_{x_j\in C}\, \sum_{x_i \in C, i\neq j}\text{dist}(x_i, x_j)

A smaller value indicates a tighter cluster based on this metric.

  • Maintainer: George Clare Kennedy
  • License: MIT + file LICENSE
  • Last published: 2025-02-20