1 · Build person vectors
Each person is collapsed to a single point in K-dimensional KPI space. Values are z-score normalised so KPIs on different scales carry equal weight.
v⃗ᵢ = [(kpi₁ − μ₁)/σ₁ , (kpi₂ − μ₂)/σ₂ , …]
2 · Distance matrix
Euclidean distance is computed between all pairs. Two points are neighbours if their distance is ≤ ε.
d(p, q) = √ Σₖ (pₖ − qₖ)²
3 · Core points & expansion
A point with ≥ minPts neighbours within ε is a core point. Clusters grow outward by density-reachability. Points unreachable from any core point are labelled noise (−1).
4 · PCA visualisation
The full K-dimensional space is projected to 2D via PCA for display only — clustering runs in the original space.
X₂ᴅ = X · V[:, 0:2]