Skip to main content

Results Analysis

This page presents the results of the AstroSpectro pipeline along two complementary axes that use different datasets. The unsupervised analysis (PCA, UMAP, t-SNE, HDBSCAN) runs on the PHY-3500 dataset: N = 43,019 LAMOST DR5 × Gaia DR3 spectra described by p = 183 spectroscopic features (PHY-3500 · G1 · 43,019 spectra). The supervised classification (XGBoost with SHAP attribution) is the reference run ST_350k_xgb_AFGKM_v6 on the 350k-spectrum generation (G2, 349,998 spectra processed).

Dimensionality reductionPHY-3500 · G1 · 43,019 spectra
PCA
Linear
PC1 = Thermal axis
+0.831
ρ(PC1, Teff)
›16.9% variance · λ₁ = 30.19
›91 components → 95% variance
›ρ(PC1, BP−RP) = −0.768
UMAP
Topological
Harvard sequence emergent
20
HDBSCAN clusters
›Continuous continent structure
›Dwarfs / giants separated without labels
›ρ(ax.1, Teff) = +0.464
t-SNE
Probabilistic
63× more reproducible
4.7×10⁻⁴
mean Procrustes dP (seeds 1–4)
›init='pca' → maximum stability
›Archipelago of compact clusters
›Perplexity 30 — optimal [15,50]
Classificationreference run 20260522T161236Z · G2 · 349,998 spectra
XGBoost
Supervised
89.2% balanced accuracy
0.986
ROC-AUC macro
›ST_350k_xgb_AFGKM_v6
›F1 macro 0.883 · accuracy 87.4%
›Test set N = 60,947
SHAP
Interpretability
Spectroscopy-driven decisions
96.8%
share of Σ|SHAP| from spectroscopic features
›Top 3: Mg b EW · CaH2 index · slope deep red
›29/30 top features are spectroscopic
›Gaia/photometric: 3.2% of Σ|SHAP|
v6 · includes 4 Gaia/photometric features — see Data Leakage Audit

Axis 1 — Unsupervised dimensionality reduction​

PHY-3500 · G1 · 43,019 spectra.

PCA — The linear baseline​

PCA on the 183 standardised features reveals high intrinsic dimensionality: 91 components are needed to capture 95% of variance, with no clear elbow in the eigenvalue spectrum.

Threshold V(K)Components KInterpretation
28.8%2PC1 + PC2 only — visualisation
80%51Fast analysis
95%91Retained threshold for UMAP/t-SNE
99%100Near-total variance
K =
2
Variance: 28.8%MSE: 0.696
PC1 + PC2 only — basic 2D visualisation.
K =
10
Variance: 49.5%MSE: 0.494
Captures about half of the variance.
K =
51
Variance: ≥ 80%MSE: n/a
Fast analysis threshold — good speed/accuracy trade-off.
K =
91
Variance: ≥ 95%MSE: n/a
RETAINED THRESHOLD FOR UMAP/t-SNE — Captures the essential variance.
K =
100
Variance: ≥ 99%MSE: n/a
Near-total variance (includes residual noise).

PC1 (16.9%, λ₁ = 30.19) — Thermal axis: ρ(PC1, Teff) = +0.831. Dominated by Balmer lines (31.5%) and ionised calcium (22.4%). Hot stars (A-F, > 7,000 K) occupy the positive side; cool stars (K-M, < 5,000 K) the negative side.

PC2 (12.0%, λ₂ = 21.39) — Metallicity axis (partially contaminated): Dominated by iron and metals (43.3%). The correlation ρ(PC2, SNRr) = −0.310 reveals instrumental contamination — PC2 is not a pure metallicity axis.

K componentsMSE(K)Variance captured
20.69630.4%
100.49450.6%
500.19680.4%
91~0.05095.0%

Eigenspectra on raw flux (10,000 spectra, 3,921 channels): Three components are sufficient to explain 91.3% of raw flux variance (vs 91 components for the 183 features). PC1_flux = colour slope (Teff) · PC2_flux = infrared rise cool stars · PC3_flux = blue/red instrumental cut.

For the complete interpretation, see Physical interpretation of PCA.

◎
Explained variance
PCA
Explained variance
Individual + cumulative · 80/90/95/99% thresholds
◎
Raw flux eigenspectra
PCA
Raw flux eigenspectra
PC1 = T_eff · PC2 = IR · PC3 = instrument cut
◎
PC1/PC2 projection
PCA
PC1/PC2 projection
Coloured by LAMOST spectral type
◎
MSE(K) error
PCA
MSE(K) error
Reconstruction decay as a function of K
◎
HR diagram coloured PC1
HR
HR diagram coloured PC1
Teff gradient along the main sequence
◎
PC1/PC2/PC3 grid
PCA
PC1/PC2/PC3 grid
Cross-projections of the first 3 components

UMAP — Topological structure and HDBSCAN clusters​

UMAP is applied to the 91 PCA components with n_neighbors=15, min_dist=0.1, 200 epochs (t = 40.1 s, Ryzen 9 5950X). The projection reveals a "continuous continent" structure where the Harvard sequence (M-K-G-F-A) unfolds without supervision.

Correlations: ρ(UMAP axis 1, Teff) = +0.464. The luminosity class (dwarfs vs giants) induces a visible topological bifurcation when coloured by log g.

Negative control: UMAP applied to data with randomly permuted columns → compact homogeneous cloud with no structure. The observed structure is of physical origin, not an algorithmic artefact.

HDBSCAN clusters — 20 groups without any label​

20
Clusters
2,643
Noise (6.14%)
16,716
Cluster C11 (stars)
10,373
Cluster C13 (stars)
Top 12 clusters — population (stars)
C11
16,716
G-K main sequence
C13
10,373
Cool K dwarfs
C5
5,083
C2
915
C19
900
Subgiants / RGB base
C12
851
Subgiants / RGB base
C3
818
C1
654
Subgiants / RGB base
C16
620
C17
615
C9
576
C7
474
min_cluster_size=75 · min_samples=20 · noise excluded from this chart
Location on the HR diagram (Teff × log g × Gaia DR3)
C19, C1, C12
Subgiants / RGB base
Strengthened Ca II · weakened Balmer → lower surface radiation pressure
C13
Cool K dwarfs
Most populated cluster with clear physical identity
C11
G-K main sequence
Dominant cluster — reference population of the main sequence
Original astrophysical result

Without any label or log g information, UMAP organises spectra such that HDBSCAN recovers the dwarf/subgiant distinction at fixed Teff. Clusters C19, C1 and C12 are spectrally distinguished by strengthened Ca II lines and weakened Balmer lines — the signature of lower radiation pressure at giant surfaces.

◎
UMAP coloured by spectral type
UMAP
UMAP coloured by spectral type
Harvard sequence emergent without supervision
◎
HDBSCAN clusters
HDBSCAN
HDBSCAN clusters
20 clusters · 6.14% noise · C11 = 16,716 stars
◎
Clusters on HR diagram
HR
Clusters on HR diagram
C19/C1/C12 = subgiants · C13 = K dwarfs
◎
Negative control
Validation
Negative control
Permuted data → homogeneous cloud without structure
◎
Feature heatmap per cluster
HDBSCAN
Feature heatmap per cluster
Distinctive spectral profiles of each cluster
◎
PCA/UMAP/AE synthesis
Synthesis
PCA/UMAP/AE synthesis
Comparison of the 3 latent spaces

t-SNE — Probabilistic structure and stability​

t-SNE is applied to the same 91 PCA components with perplexity=30, init='pca', 1,000 iterations (t = 80.2 s, i.e. 2× UMAP). The projection produces an "archipelago" of compact separated masses, opposite to the continuous UMAP structure.

  • Hot stars (A-F, Teff > 7,000 K) form a distinct isolated cluster
  • The central mass groups K-G main-sequence stars
  • Log g colouring reveals partially isolated subgiant clusters

t-SNE excels at sharp separation of discrete sub-populations, while UMAP better preserves continuous gradients (Teff, [Fe/H]).


Stability comparison — Procrustes​

~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.

Comparative synthesis — PCA · UMAP · t-SNE​

PCA
Linear
UMAP
Topological
t-SNE
Probabilistic
Reconstruction MSE (K=2)
PCA only — Eckart-Young
0.696
—
—
ρ(axis 1, Teff)
Spearman correlation with Gaia T_eff (t-SNE: not exported)
+0.831
+0.464
—
Stability dP (Procrustes)
t-SNE ~63× more reproducible than UMAP (mean, seeds 1–4)
0 (exact)
3.0 × 10⁻²
4.7 × 10⁻⁴
Fit time
Wall-clock time of the reference run (PCA: not recorded)
—
40.1 s
80.2 s
Parametric
Can generalise out-of-sample
Yes
Partial
No
Non-linear
Captures non-linear structures
✗
✓
✓
Interpretable
Axes with direct physical meaning
✓
✗
✗
● = best value on this row
◎
t-SNE projection
t-SNE
t-SNE projection
Archipelago coloured by spectral type, T_eff, log g, [Fe/H]
◎
HR diagram coloured t-SNE axis 1
HR
HR diagram coloured t-SNE axis 1
Thermal correlation in t-SNE space
◎
Perplexity sensitivity
Sensitivity
Perplexity sensitivity
Robust for perplexity in [15, 50]
◎
UMAP stability (4 seeds)
Procrustes
UMAP stability (4 seeds)
d_P ~ 0.030 — significant run-to-run variability
◎
t-SNE stability (4 seeds)
Procrustes
t-SNE stability (4 seeds)
d_P ~ 5×10⁻⁴ — 60× more stable than UMAP
◎
UMAP vs t-SNE side by side
Comparison
UMAP vs t-SNE side by side
Continuous continent vs compact archipelago

Axis 2 — Supervised XGBoost classification​

G2 · reference run ST_350k_xgb_AFGKM_v6.

Global performance (spectro_only=True mode)​

The reference classifier is trained on the 350k-spectrum generation, not on the PHY-3500 dataset: 207 candidate columns, 99 selected features, five types A, F, G, K, M. On its test set it achieves:

BA
89.2%
Balanced accuracy
balanced accuracy · 5 classes
On types A, F, G, K, M
F1
0.883
Macro F1
test set · N = 60,947
Accuracy 87.4%
AUC
0.986
ROC-AUC macro
global discriminability
1.000 = perfect
ST_350k_xgb_AFGKM_v6 · run 20260522T161236Z · G2 · 349,998 spectra
v6 · includes 4 Gaia/photometric features — see Data Leakage Audit
Gaia leak in run v6

Run v6 (ST_350k_xgb_AFGKM_v6) was trained with spectro_only enabled, but its 99 selected features include 4 Gaia/photometric columns (M_G, M_BP, M_RP, ag_gspphot). Its metrics are therefore not purely spectroscopic; see the Data Leakage Audit.

Historical pipeline progression​

1
v3 · G1 · 99,999 spectra
86.4%
XGBoost
103 features · 3 Gaia/phot.
⚠ run 20260306T011253Z
→
2
v5 · G1 · 99,999 spectra
87.3%
XGBoost
98 features · 1 Gaia/phot.
⚠ run 20260306T020848Z
→
CURRENT
3
v6 · G2 · 349,998 spectra
89.2%
XGBoost
99 features · 4 Gaia/phot.
⚠ run 20260522T161236Z
Reading this timeline: each step is a recorded run; the value is the balanced accuracy on its own test set (A, F, G, K, M). Runs differ in sample size and feature set, so the steps are not a controlled ablation. ⚠ marks runs whose selected features include Gaia/photometric columns.
v6 · includes 4 Gaia/photometric features — see Data Leakage Audit

Supervised / unsupervised coherence​

This comparison uses the PHY-3500 UMAP (G1) and the predictions of an earlier model (run v5), not the reference run. The geographic distribution of XGBoost predictions in UMAP space is coherent with the emergent unsupervised structure: A-type stars in a hot "peninsula", G at the centre, K at the cool periphery. Both approaches capture the same physical structure — the UMAP projection is a qualitative validation space for the classifier.

◎
XGBoost predictions in UMAP
XGBoost
XGBoost predictions in UMAP
Geographic coherence supervised/unsupervised
◎
F/G confusion
XGBoost
F/G confusion
Continuous transition zone at 5500–6200 K

Axis 3 — SHAP validation​

Central result​

G2 · SHAP of the reference run.

SHAP (SHapley Additive exPlanations) analysis of the reference run attributes 96.8% of the total mean |SHAP| to spectroscopic features and 3.2% to Gaia/photometric columns; 29 of the 30 most important features are spectroscopic. This suggests that the model classifies stars mainly from the same spectroscopic information that astrophysicists use, with a small but non-zero contribution of the leaked Gaia columns. (The figure of 97.9% quoted on older pages is the same share of total importance for run v5, G1.) Details: Scientific Validation and SHAP Interpretability.

⚡
Top SHAP feature — Mg b EW (Mg b)
The top 10 span 7 feature families; spectroscopic features carry 96.8% of the total mean |SHAP| for ST_350k_xgb_AFGKM_v6.
Mg b (1 in top-10)
Ca II (2 in top-10)
Continuum (2 in top-10)
Hα (Balmer) (1 in top-10)
Mol. CN/CH (2 in top-10)
Hβ (Balmer) (1 in top-10)
Na D (1 in top-10)
mean |SHAP| — model run 20260522T161236Z · G2 · 349,998 spectra
#
Feature
SHAP Importance
Family
1
Mg b EW
0.43
Mg b
2
CaH2 index
0.35
Ca II
3
slope deep red
0.30
Continuum
4
CaIIK EW
0.29
Ca II
5
Hα EW
0.27
Hα (Balmer)
6
continuum rms
0.26
Continuum
7
G4300 index
0.20
Mol. CN/CH
8
CN 2 index
0.19
Mol. CN/CH
9
Hbeta index
0.19
Hβ (Balmer)
10
Na D EW
0.17
Na D
29/30 of the 30 most important features (SHAP top-30) are spectroscopic; they carry 96.8% of the total mean |SHAP|. Hover bars to see the pipeline name of each feature.
v6 · includes 4 Gaia/photometric features — see Data Leakage Audit

PCA vs XGBoost — two complementary questions​

PCA ranks features by the variance they carry, SHAP by how much they help separate the classes. To keep both sides on the same data, this comparison uses the PHY-3500 PCA and the SHAP run of the same generation (G1, model v5), not the reference run:

PCA phy3500_pca_run_20260408T012751Z (PHY-3500 · G1 · 43,019 spectra) · SHAP ST_100k_xgb_AFGKM_v5 (run 20260306T020848Z · G1 · 99,999 spectra)
PCA
Direction of maximum variance
Unsupervised
Dominant feature
Hα EW
top PC1 loading +0.173 · PC1 = 16.9% variance
Physical result
Temperature T_eff
ρ(PC1, Teff) = +0.831
›Maximises total variance
›Balmer and continuum shape load PC1 → thermal axis
›Temperature = variance source #1
›No labels used
XGBoost
Optimal decision boundary
Supervised
Dominant feature
CaH2 index
SHAP top 3: CaH2 index · Mg b EW · Hα EW
Physical result
Spectroscopic features dominate
97.9% of Σ|SHAP| · 29/30 top features
›Minimises classification error
›SHAP on ST_100k_xgb_AFGKM_v5 (98 features)
›Mixes molecular bands, Mg b and Balmer lines
›Spectral type labels used
✓ These two results are complementary — they answer two different questions. PCA answers: "what is the dominant source of variance?" → temperature. XGBoost answers: "what information best separates classes?" → the SHAP ranking of ST_100k_xgb_AFGKM_v5 (same feature generation as the PCA), led by CaH2 index.
v5 · includes 1 Gaia/photometric feature — see Data Leakage Audit

Top SHAP features per class​

Leading features per class in the reference run (read from the per-class SHAP figure of logs/shap/features_20260522T153123Z/01_data_leak/, G2):

ClassLeading features (mean |SHAP| per class)Physical interpretation
ACa II K EW, G4300 index, CN index, Hβ indexWeak metal lines and strong Balmer lines of hot stars
FMg b EW, Na D EW, continuum curvatureOnset of metal lines as temperature decreases
GMg I 5184 EW, CNO index, Hα/Hβ EW ratioGradual metal-line growth, weakening Balmer lines
KMg b EW, Hα EW, deep-red continuum slopeStrong metal lines, red continuum
MCaH2 index, deep-red slope, continuum RMS, TiO5Molecular band signatures
◎
Class-specific importance
SHAP · G2
Class-specific importance
G2 · SHAP of the reference run v6 — top features per spectral type
◎
Beeswarm per class
SHAP · G2
Beeswarm per class
G2 · SHAP of the reference run v6 — direction of each feature effect

Limitations and next steps​

Class imbalance: in the PHY-3500 dataset (G1), galaxies (56) and QSOs (7) are too rare for HDBSCAN analysis. The classifier (G2) works on the stellar types A, F, G, K, M only.

Gaia leak: the reference classifier includes Gaia/photometric features; a fully spectroscopic reference run is still to be completed (see Current Status).

Intrinsic dimensionality: The 91 components needed for 95% variance indicate that spectral diversity is genuinely high-dimensional. The 2D projection is an extreme compression (183 → 2), and the emergence of the Harvard sequence in these two dimensions is a non-trivial result.

Next steps:

  • Characterisation of the 20 HDBSCAN clusters by cross-matching with rare object catalogues (variable stars, RGB giants, spectroscopic binaries)
  • Systematic hyperparameter optimisation (Optuna) on the full generation
  • Anomaly analysis: intersection of HDBSCAN noise ∩ top 1% MSE autoencoder
  • Extension to LAMOST DR10 (~10⁷ spectra) or SDSS