Nearest-centroid decision hyperplane (source code)

= Nearest-centroid decision hyperplane
{title2=$2(z_1-z_2)^{\mathsf T}x+\|z_2\|^2-\|z_1\|^2=0$}

For two distinct <centroids> in a <Euclidean space>, equal squared <Euclidean distances> expand to the displayed affine <hyperplane>. It is their <perpendicular bisector>; each closed <half-space> consists of points at least as close to the centroid on that side. This proves weak <linear separability> after a two-centroid nearest-assignment step, allowing ties on the boundary. Coincident <centroids> are an essential exception: every point ties and the distance comparison supplies no nonzero normal vector.