Results of this run
Ward agglomerative merges of Customer Segments stop at k=4, linkage=ward. Ward silhouette is 0.357, Ward Calinski-Harabasz is 362.7, Ward Davies-Bouldin is 1.150. Held-out segment versus the Ward cut: adjusted Rand 0.708. 0 noise rows out of 200 after the merges. Ward merge 0 on Customer Segments holds 44 rows (annual_income 56664.6 / avg_spend 1684.4). Ward merge 1 on Customer Segments holds 35 rows (annual_income 48889.0 / avg_spend 752.0). Ward merge 2 on Customer Segments holds 50 rows (annual_income 78401.2 / avg_spend 2953.6). Ward merge 3 on Customer Segments holds 71 rows (annual_income 32966.6 / avg_spend 678.7). Ward k path: k 2 merges to 0.608 with 2 groups on Customer Segments; k 3 merges to 0.481 with 3 groups on Customer Segments; k 4 merges to 0.357 with 4 groups on Customer Segments; k 5 merges to 0.327 with 5 groups on Customer Segments; k 6 merges to 0.215 with 6 groups on Customer Segments; k 7 merges to 0.170 with 7 groups on Customer Segments; k 8 merges to 0.175 with 8 groups on Customer Segments. Ward scatter keeps 90.5%.

| k | Silhouette | Clusters |
|---|---|---|
| 2 | 0.608 | 2 |
| 3 | 0.481 | 3 |
| 4 | 0.357 | 4 |
| 5 | 0.327 | 5 |
| 6 | 0.215 | 6 |
| 7 | 0.170 | 7 |
| 8 | 0.175 | 8 |
from sklearn.cluster import AgglomerativeClustering
from sklearn.preprocessing import StandardScaler
Xs = StandardScaler().fit_transform(X)
labels = AgglomerativeClustering(n_clusters=4, linkage='ward').fit_predict(Xs)
Who, how, and why
Method: StandardScaler, drop constant columns. Code version 3e4afc4b4352 (scripts/seo/build_explore_artifacts.py). scikit-learn 1.4.2. Seed 42. Dataset source: Synthetic customer records bundled with this site. License: Generated for demos; no external license. The segment column was held out of the fit and used only for the adjusted Rand score.
Results computed on 2026-11-02.
The results paragraph is filled from these numbers by a fixed template in the site code, so the scores can be checked against the same dataset in the tool.
Maintainer: nikolaou1982.
Contact: nick1982100@gmail.com.
