Author Contributions
Conceptualization, I.A. and H.S.; methodology, I.A.; software, I.A.; validation, I.A. and H.S.; formal analysis, I.A.; investigation, I.A.; data curation, I.A.; writing—original draft preparation, I.A.; writing—review and editing, I.A. and H.S.; visualization, I.A.; supervision, H.S. All authors have read and agreed to the published version of the manuscript.
Figure 1.
Experimental pipeline. The TCGA expression compendium is preprocessed and used to train the two primary clustering methods (SOM and K-means) across a range of cluster cardinalities under a 25-seed protocol. Two post hoc baselines are derived from the trained models (consensus K-means from the K-means co-assignment matrix and SOM-Super20 from each SOM’s codebook), and four modern clustering baselines (HDBSCAN, spectral, Gaussian mixtures, Leiden) are added for breadth. All methods are evaluated through paired stability metrics, per-cancer effective coverage, and—for the SOM—visual diagnostics. Pipeline scripts and trained artifacts are released for reproducibility.
Figure 1.
Experimental pipeline. The TCGA expression compendium is preprocessed and used to train the two primary clustering methods (SOM and K-means) across a range of cluster cardinalities under a 25-seed protocol. Two post hoc baselines are derived from the trained models (consensus K-means from the K-means co-assignment matrix and SOM-Super20 from each SOM’s codebook), and four modern clustering baselines (HDBSCAN, spectral, Gaussian mixtures, Leiden) are added for breadth. All methods are evaluated through paired stability metrics, per-cancer effective coverage, and—for the SOM—visual diagnostics. Pipeline scripts and trained artifacts are released for reproducibility.
Figure 2.
U-matrix visualizations across the grid size sweep. Darker cells indicate larger average distances to lattice neighbors (potential boundaries between groups); lighter cells indicate locally homogeneous regions. The configuration was selected as the operating point.
Figure 2.
U-matrix visualizations across the grid size sweep. Darker cells indicate larger average distances to lattice neighbors (potential boundaries between groups); lighter cells indicate locally homogeneous regions. The configuration was selected as the operating point.
Figure 5.
Capacity-matched stability scaling for K-means (n_init = 1 and n_init = 20) and SOMs across a shared log-scaled prototype axis, where # denotes SOM nodes. Left panels show within-method pairwise NMI/ARI; right panels show agreement with recorded labels. K-means is more reproducible at every matched budget; its pairwise ARI decreases with increasing k due to overfragmentation, while NMI remains stable.
Figure 5.
Capacity-matched stability scaling for K-means (n_init = 1 and n_init = 20) and SOMs across a shared log-scaled prototype axis, where # denotes SOM nodes. Left panels show within-method pairwise NMI/ARI; right panels show agreement with recorded labels. K-means is more reproducible at every matched budget; its pairwise ARI decreases with increasing k due to overfragmentation, while NMI remains stable.
Figure 6.
Per-cancer effective coverage (capture × purity) for all 19 cancer types (rows, largest at top) across the evaluated methods and capacities (columns). High-capacity K-means (KM_k100/k400) is the only method family with non-zero pancreas coverage and provides strong coverage across all three smallest classes. SOMs provide low but non-zero coverage for testes and thymus; spectral clustering and Leiden also strongly recover testes and thymus but not pancreas.
Figure 6.
Per-cancer effective coverage (capture × purity) for all 19 cancer types (rows, largest at top) across the evaluated methods and capacities (columns). High-capacity K-means (KM_k100/k400) is the only method family with non-zero pancreas coverage and provides strong coverage across all three smallest classes. SOMs provide low but non-zero coverage for testes and thymus; spectral clustering and Leiden also strongly recover testes and thymus but not pancreas.
Figure 7.
Minority class effective coverage across all evaluated methods for the three most challenging classes (pancreas, testes, thymus), sorted within each panel. Bars at zero (highlighted) mark methods that fail to recover the class. Pancreas is recovered only by high-capacity K-means; spectral clustering and Leiden recover testes and thymus but not pancreas.
Figure 7.
Minority class effective coverage across all evaluated methods for the three most challenging classes (pancreas, testes, thymus), sorted within each panel. Bars at zero (highlighted) mark methods that fail to recover the class. Pancreas is recovered only by high-capacity K-means; spectral clustering and Leiden recover testes and thymus but not pancreas.
Figure 8.
K-means per-cancer effective coverage as a function of (n_init = 1), sorted by class size (largest left). Minority class coverage rises monotonically with k, while majority class coverage is already saturated at small k.
Figure 8.
K-means per-cancer effective coverage as a function of (n_init = 1), sorted by class size (largest left). Minority class coverage rises monotonically with k, while majority class coverage is already saturated at small k.
Figure 9.
Global views of the operating-point () SOM. Panel (a) shows the hit map representing the number of samples mapped to each SOM node. Brighter edge and corner regions illustrate the border attraction behavior commonly observed in rectangular SOM lattices. Panel (b) shows the dominant cancer label associated with each node, demonstrating spatially coherent territories for multiple cancer types across the SOM topology.
Figure 9.
Global views of the operating-point () SOM. Panel (a) shows the hit map representing the number of samples mapped to each SOM node. Brighter edge and corner regions illustrate the border attraction behavior commonly observed in rectangular SOM lattices. Panel (b) shows the dominant cancer label associated with each node, demonstrating spatially coherent territories for multiple cancer types across the SOM topology.
Figure 10.
Per-node label purity (maximum class count divided by total node hits). Dark green nodes () are locally homogeneous; orange nodes (0.3–0.5) reflect overlap among multiple cancer types.
Figure 10.
Per-node label purity (maximum class count divided by total node hits). Dark green nodes () are locally homogeneous; orange nodes (0.3–0.5) reflect overlap among multiple cancer types.
Figure 11.
Gradient-territory reproducibility across 25 operating-point () SOM seeds. Kidney is largely coherent (largest-component fraction ; seeds ), whereas uterus is more fragmented (; ), indicating greater seed dependence. Each panel shows one seed; only cancer-dominant nodes are colored, with darker green indicating higher dominant-label purity.
Figure 11.
Gradient-territory reproducibility across 25 operating-point () SOM seeds. Kidney is largely coherent (largest-component fraction ; seeds ), whereas uterus is more fragmented (; ), indicating greater seed dependence. Each panel shows one seed; only cancer-dominant nodes are colored, with darker green indicating higher dominant-label purity.
Figure 12.
Per-cancer case studies on a representative operating-point (
) SOM. Each panel contains density visualization and a dominant node purity analysis for the corresponding cancer type. Brain forms a compact and highly pure cluster structure, while kidney and uterus exhibit continuous gradient-like manifold organization across the SOM lattice. Pancreas appears intrinsically dispersed, with samples distributed across multiple regions and without a single dominant territory. Panels show one representative operating-point seed; the seed stability of the kidney and uterus territories across all 25 seeds is quantified in
Figure 11. Here, # denotes the number of samples mapped to a node; density-map color scales encode sample counts, purity-map color scales encode dominant-node purity, and in panel (d) cyan circles mark uterus-dominant nodes.
Figure 12.
Per-cancer case studies on a representative operating-point (
) SOM. Each panel contains density visualization and a dominant node purity analysis for the corresponding cancer type. Brain forms a compact and highly pure cluster structure, while kidney and uterus exhibit continuous gradient-like manifold organization across the SOM lattice. Pancreas appears intrinsically dispersed, with samples distributed across multiple regions and without a single dominant territory. Panels show one representative operating-point seed; the seed stability of the kidney and uterus territories across all 25 seeds is quantified in
Figure 11. Here, # denotes the number of samples mapped to a node; density-map color scales encode sample counts, purity-map color scales encode dominant-node purity, and in panel (d) cyan circles mark uterus-dominant nodes.
Table 1.
Class distribution of the TCGA-derived compendium (), sorted by class size.
Table 1.
Class distribution of the TCGA-derived compendium (), sorted by class size.
| Cancer | n | Cancer | n | Cancer | n |
|---|
| Squamous | 1507 | Lung | 599 | Adrenal | 256 |
| Breast | 1153 | Thyroid | 553 | Leukemia | 199 |
| Kidney | 974 | Uterus | 530 | Pancreas | 151 |
| Brain | 696 | Prostate | 525 | Testes | 110 |
| Colorectal | 659 | Melanoma | 512 | Thymus | 106 |
| Liver | 455 | Stomach | 433 | | |
| Ovary | 357 | Sarcoma | 320 | | |
Table 2.
Computational cost per run, mean ± standard deviation across 25 random seeds on a multi-core CPU workstation. Consensus K-means is built post hoc from the 25 saved K-means assignments; SOM-Super20 is built post hoc from saved SOM codebooks via codebook K-means.
Table 2.
Computational cost per run, mean ± standard deviation across 25 random seeds on a multi-core CPU workstation. Consensus K-means is built post hoc from the 25 saved K-means assignments; SOM-Super20 is built post hoc from saved SOM codebooks via codebook K-means.
| Method | Train + Assign (s) | Relative | Total Wall Time (25 Seeds) |
|---|
| K-means single-run | | | min |
| SOM (20×20) | | ∼ | h |
| SOM-Super20 (post hoc) | per seed | | min |
| Consensus K-means | (deterministic, single build) | — | min |
Table 3.
Grid size sweep quality metrics. QE = quantization error; TE = topographic error; # = number of SOM nodes; occupancy = fraction of nodes with ≥1 sample mapped.
Table 3.
Grid size sweep quality metrics. QE = quantization error; TE = topographic error; # = number of SOM nodes; occupancy = fraction of nodes with ≥1 sample mapped.
| Grid | # Nodes | QE | TE | Weighted Purity | Occupancy |
|---|
| 225 | 87.41 | 0.0159 | 0.647 | 1.00 |
| 400 | 87.70 | 0.0099 | 0.639 | 0.97 |
| 625 | 88.21 | 0.0095 | 0.659 | 0.94 |
| 900 | 87.39 | 0.0077 | 0.660 | 0.87 |
Table 5.
Within-method pairwise stability as a function of cluster cardinality (K-means
k; SOM lattice nodes),
n_init = 1 for K-means, mean over
pairs. K-means is more stable than SOMs at every matched prototype budget; K-means’ pairwise ARI falls as
k grows, while NMI is preserved.
Table 4 reports the reference MiniSom operating-point runs, whereas the SOM values in this capacity sweep come from independently trained PyTorch/GPU runs, as described in
Section 3.3.
Table 5.
Within-method pairwise stability as a function of cluster cardinality (K-means
k; SOM lattice nodes),
n_init = 1 for K-means, mean over
pairs. K-means is more stable than SOMs at every matched prototype budget; K-means’ pairwise ARI falls as
k grows, while NMI is preserved.
Table 4 reports the reference MiniSom operating-point runs, whereas the SOM values in this capacity sweep come from independently trained PyTorch/GPU runs, as described in
Section 3.3.
| Method | Prototypes | Pairwise NMI | Pairwise ARI |
|---|
| K-means | 19 | 0.789 | 0.656 |
| K-means | 20 | 0.782 | 0.643 |
| K-means | 25 | 0.787 | 0.637 |
| K-means | 50 | 0.835 | 0.649 |
| K-means | 100 | 0.835 | 0.574 |
| K-means | 200 | 0.824 | 0.488 |
| K-means | 400 | 0.819 | 0.419 |
| SOM | 25 | 0.555 | 0.332 |
| SOM | 100 | 0.582 | 0.309 |
| SOM | 225 | 0.599 | 0.296 |
| SOM | 400 | 0.621 | 0.286 |
| SOM | 625 | 0.644 | 0.286 |
Table 6.
Effective coverage (, capture × purity) on the three most challenging minority classes, across all evaluated methods and capacities. K-means and SOM values aggregate over 25 seeds (n_init = 1 for K-means unless noted); consensus K-means and SOM-Super20 are post hoc; HDBSCAN is the best of four density settings; deterministic methods are run once. At matched 400 prototypes, K-means exceeds SOMs 6–, SOMs do not close the gap even at 625 nodes, and pancreas is recovered only by high-capacity K-means. Bold values indicate the highest effective coverage in each minority-class column.
Table 6.
Effective coverage (, capture × purity) on the three most challenging minority classes, across all evaluated methods and capacities. K-means and SOM values aggregate over 25 seeds (n_init = 1 for K-means unless noted); consensus K-means and SOM-Super20 are post hoc; HDBSCAN is the best of four density settings; deterministic methods are run once. At matched 400 prototypes, K-means exceeds SOMs 6–, SOMs do not close the gap even at 625 nodes, and pancreas is recovered only by high-capacity K-means. Bold values indicate the highest effective coverage in each minority-class column.
| Method | Prototypes | Pancreas | Testes | Thymus |
|---|
| | | ()
| () | () |
|---|
| SOM | 25 | 0.000 | 0.032 | 0.000 |
| SOM | 100 | 0.017 | 0.109 | 0.096 |
| SOM | 400 | 0.054 | 0.163 | 0.117 |
| SOM | 625 | 0.072 | 0.207 | 0.177 |
| K-means (n_init = 1) | 20 | 0.000 | 0.088 | 0.063 |
| K-means (n_init = 20) | 20 | 0.000 | 0.193 | 0.043 |
| K-means | 100 | 0.342 | 0.947 | 0.870 |
| K-means | 400 | 0.760 | 0.973 | 0.991 |
| Consensus K-means | 20 | 0.000 | 0.000 | 0.000 |
| SOM-Super20 | 20 | 0.000 | 0.000 | 0.000 |
| HDBSCAN (best of 4) | — | 0.000 | 0.000 | 0.000 |
| Gaussian mixture | 20 | 0.000 | 0.085 | 0.073 |
| Spectral | 20 | 0.000 | 0.952 | 0.981 |
| Leiden | — | 0.000 | 0.946 | 0.935 |