L-p metrics
Manhattan distance (L1)
Given two vectors and , such that
0
we define the Manhattan distance as:
1
Euclidean distance (L2)
In general, for points given by Cartesian coordinates in -dimensional Euclidean space, the distance is
2
Cluster distances
Within-cluster sum of squares (WCSS)
Given a set of observations (), where each observation is a -dimensional real vector, -means clustering aims to partition the observations into () sets so as to minimize the within-cluster sum of squares (WCSS) (i.e. variance). Formally, the objective is to find:
3
where is the mean of points in . This is equivalent to minimizing the pairwise squared deviations of points in the same cluster:
4
The equivalence can be deduced from identity
5
Because the total variance is constant, this is equivalent to maximizing the sum of squared deviations between points in different clusters (between-cluster sum of squares, BCSS) which follows from the law of total variance.
Dunn index
A full explanation is available at Dunn index.
Gower distance
A full explanation with examples is available at Gower distance.