What is AstroSpectro?
AstroSpectro is an open-source, interpretable machine-learning pipeline for stellar spectral classification using data from the LAMOST DR5 survey cross-matched with Gaia DR3.
The project is designed to answer a fundamental question:
What physical information are modern machine-learning models actually learning from stellar spectra?
What it does
- Ingests raw FITS spectra from LAMOST DR5
- Preprocesses and normalises spectra (continuum removal, inverse-variance weighting)
- Extracts 183 physics-based spectroscopic features (line profiles, equivalent widths, molecular bands, continuum indices)
- Trains an XGBoost classifier in
spectro_only=Truemode — no positional or instrumental metadata - Applies PCA, UMAP, t-SNE, and autoencoder for dimensionality reduction and structure discovery
- Validates classification decisions using SHAP interpretability
What makes it different
- Physics-first features: every feature corresponds to a physically interpretable spectral property
- Leakage-free mode:
spectro_only=Trueremoves all non-physical metadata - SHAP validation: model decisions are validated against known astrophysical priors
- Full reproducibility: every run saves a session report (hyper-parameters, selected features, model MD5), with optional Weights & Biases logging