Results of this run
Spectral clustering embeds Customer Segments with an RBF affinity and cuts k=4, affinity=rbf. Graph silhouette is 0.367, graph Calinski-Harabasz is 369.6, graph Davies-Bouldin is 1.121. Held-out segment versus the graph cut: adjusted Rand 0.751. 0 noise rows out of 200 in the embedding. Graph group 0 on Customer Segments holds 50 rows (annual_income 78401.2 / avg_spend 2953.6). Graph group 1 on Customer Segments holds 39 rows (annual_income 48577.4 / avg_spend 642.4). Graph group 2 on Customer Segments holds 46 rows (annual_income 55872.4 / avg_spend 1681.9). Graph group 3 on Customer Segments holds 65 rows (annual_income 32005.2 / avg_spend 710.7). Spectral k path: k 2 cuts 0.608 with 2 groups on Customer Segments; k 3 cuts 0.489 with 3 groups on Customer Segments; k 4 cuts 0.367 with 4 groups on Customer Segments; k 5 cuts 0.350 with 5 groups on Customer Segments; k 6 cuts 0.238 with 6 groups on Customer Segments; k 7 cuts 0.245 with 7 groups on Customer Segments; k 8 cuts 0.233 with 8 groups on Customer Segments. Graph scatter keeps 90.5%.

| k | Silhouette | Clusters |
|---|---|---|
| 2 | 0.608 | 2 |
| 3 | 0.489 | 3 |
| 4 | 0.367 | 4 |
| 5 | 0.350 | 5 |
| 6 | 0.238 | 6 |
| 7 | 0.245 | 7 |
| 8 | 0.233 | 8 |
from sklearn.cluster import SpectralClustering
from sklearn.preprocessing import StandardScaler
Xs = StandardScaler().fit_transform(X)
labels = SpectralClustering(n_clusters=4, random_state=42).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.
