K-means clustering finds centroids unsupervised. Those centroids define a separating hyperplane. Confusion matrices, ROC curves, and logistic probability evaluate and refine the classifier.
Both methods converge to the same fixed point. The centroid is the member of the cluster nearest to the cluster mean (not the mean itself, since the mean may not be a data point).
Any point equidistant from both centroids lies on the hyperplane. This is derived by expanding $\|\vec{t}-\vec{g}_1\|^2 = \|\vec{t}-\vec{g}_2\|^2$.
The unit normal form uses a vector of magnitude 1. The signed distance $d = \vec{n}^T\vec{a} + c$ is the perpendicular distance from the hyperplane: positive on the +1 side, negative on the $-1$ side.
Maps the signed distance $d$ to a probability in $(0,1)$. When $d = 0$ (on the hyperplane): $p = 0.5$. When $d \to +\infty$: $p \to 1$. When $d \to -\infty$: $p \to 0$.
Odds $s$ is the ratio of the probability of the event to the probability of the non-event.
For threshold $\theta$: classify as $+1$ if score $z_i \geq \theta$, else $-1$. Work through each observation: compare label vs. classification to find TP/FP/TN/FN.
One ROC point per threshold $\theta$. Plot TPR vs. FPR as $\theta$ varies. Ideal classifier: top-left corner (FPR=0, TPR=1). Random classifier: diagonal line. AUC = area under the ROC curve $\in [0,1]$.