Skip to main content

Sensitivity & Reproducibility

This page asks whether the structures seen in the UMAP, t-SNE and HDBSCAN analyses depend on the hyper-parameters or on the random seed. It applies to the 183 spectroscopic features of the PHY-3500 · G1 · 43,019 spectra analysis set, reduced to 91 principal components before embedding. Only some parameters were swept; the page says which, and which were not.

Run

PHY-3500 · G1 · 43,019 spectra — UMAP / t-SNE / HDBSCAN run phy3500_umap_tsne_run_20260405T214233Z (timings, seeds) and its summary phy3500_umap_tsne_run_20260430T215407Z (HDBSCAN). Nothing on this page comes from the G2 runs.


What was varied​

MethodParameterValues testedValue retainedFixed during the sweeps
UMAPn_neighbors5, 15, 30, 50, 10015min_dist = 0.1, metric, epochs
t-SNEperplexity5, 15, 30, 50, 10030PCA initialisation, 1,000 iterations
HDBSCANmin_cluster_sizegrid of five values (compute_sensitivity)75min_samples = 20, Euclidean, eom selection
Not swept

min_dist (UMAP) and min_samples (HDBSCAN) were not varied: the run reports contain embedding shapes only for n_neighbors and perplexity, and compute_sensitivity refits HDBSCAN for different min_cluster_size values at fixed min_samples. Statements about their influence would be untested.


UMAP and t-SNE hyper-parameters​

For each value the full embedding was recomputed on the same input; the run report stores only the shape of each embedding, so the comparison is visual, from the sensitivity figures below. The verdicts in the table are qualitative readings of those figures, not computed scores.

Robust structure for n_neighbors ∈ [15, 50]
Position on the local ↔ global spectrum
5
too local
too global
15
too local
too global
30
too local
too global
50
too local
too global
100
too local
too global
5
Fragmentation into very compact clusters, global structure lost
✗ Avoid
15
Best local/global trade-off — retained value
✓ Retained
30
Robust structure, slight coalescence
◎ Robust
50
Qualitative structure preserved
◎ Robust
100
Cluster coalescence, loss of detail
✗ Avoid

Across the five n_neighbors panels, the overall layout — a large elongated structure and a more compact one — persists, while very small values break it into more fragments and very large values merge sub-structures. This is consistent with the usual trade-off of the parameter between local and global structure; it supports retaining a mid-range value but does not prove that value is optimal.


HDBSCAN: min_cluster_size​

The number of clusters depends strongly on min_cluster_size: the sweep figure shows the cluster count falling steadily as the minimum size grows, while the noise fraction stays within a few percent and varies non-monotonically.

SettingClustersNoise points
Fine analysis (min_cluster_size = 75)202,643 (6.14 %)
Presentation mode132,617 (6.08 %)

The cluster count is a resolution choice, not a property of the data. The fine setting is used for physical interpretation of small groups; the presentation setting merges them for readability. Any cluster-based claim should state which setting it uses.


Seed stability (Procrustes)​

Procrustes distance measures how much two embeddings differ after optimal translation, rotation and scaling; 0 means identical shape. Embeddings were recomputed with different random seeds and compared with the seed-0 reference (seed 0 is the reference itself and is excluded from the means).

~63×
t-SNE is more reproducible than UMAP
Counter-intuitive result — both methods use SGD
UMAP
Spectral initialisation — SGD with negative sampling
6e-2
3e-2
0
μ = 3.0e-2
g1
g2
g3
g4
Mean dP0.030
t-SNE
init='pca' — KL penalty concentrated locally
6e-2
3e-2
0
μ = 4.7e-4
g1
g2
g3
g4
Mean dP4.7e-4
UMAP unstable: Spectral initialisation (Laplacian) varies between seeds. SGD with negative sampling introduces strong stochasticity in repulsive forces.
t-SNE stable: init='pca' fixes an identical starting position. The KL penalty only penalises nearby neighbours — insensitive to the seed for large structures.

t-SNE embeddings are far more reproducible across seeds than UMAP embeddings on this set. The t-SNE distances are one to two orders of magnitude below the UMAP ones for the same seeds (compare the bar heights above). A plausible contributor is the fixed PCA initialisation of t-SNE, but the runs do not isolate that effect, so this remains an interpretation. Either way, UMAP axes should not be compared quantitatively between runs; qualitative structure is what is reproducible.


Recommendations​

QuestionRecommendationEvidence
Which n_neighbors / perplexity to use?Mid-range values as retained aboveVisual comparison only
Quoting a number of clusters?Always give min_cluster_size and the modeCluster count depends on it
Comparing two UMAP runs?Compare topology, not coordinatesSeed-to-seed Procrustes distances
Reproducing a run exactly?Fix the seed (random_state = 42 by default in the loader and engines) and keep the PCA input identicalCode defaults

Reference figures​

◎
UMAP embedding for n_neighbors = 5…100
UMAP
UMAP embedding for n_neighbors = 5…100
PHY-3500 · G1 · 43,019 spectra
◎
t-SNE embedding for perplexity = 5…100
t-SNE
t-SNE embedding for perplexity = 5…100
PHY-3500 · G1 · 43,019 spectra
◎
HDBSCAN clusters and noise vs min_cluster_size
HDBSCAN
HDBSCAN clusters and noise vs min_cluster_size
PHY-3500 · G1 · 43,019 spectra
◎
UMAP Procrustes distance per seed
Stability
UMAP Procrustes distance per seed
PHY-3500 · G1 · 43,019 spectra
◎
t-SNE Procrustes distance per seed
Stability
t-SNE Procrustes distance per seed
PHY-3500 · G1 · 43,019 spectra

Figure titles in the images are in French (original notebook output).