Skip to main content

F/G Confusion Analysis

This page documents where the reference XGBoost classifier confuses F and G stars and why this boundary is expected to be ambiguous. Metrics and SHAP figures come from the reference run on the 350k-spectrum generation (G2); the UMAP picture of the transition zone comes from the PHY-3500 dimensionality-reduction study (PHY-3500 · G1 · 43,019 spectra) and is discussed separately.

Current runST_350k_xgb_AFGKM_v6
Experiment
ST_350k_xgb_AFGKM_v6
Saved (UTC)
20260522T161236Z
MD5
e752bb7ce5494364364f77a4200aa480
Stack
Python 3.11.9 / XGBoost 3.1.1
Full dataset retraining — 350k spectra — best params from v5 — spectro_only — isotonic calibrationFor detailed metrics →
v6 · includes 4 Gaia/photometric features — see Data Leakage Audit

Key results​

Reference run ST_350k_xgb_AFGKM_v6, test set of 60,947 spectra:

QuantityFG
Precision0.8100.885
Recall0.8350.839
F10.8220.861
Test spectra (support)12,80321,902
Misclassified into the other class1,478 true F predicted G2,179 true G predicted F

For comparison, the other errors of these two classes: true F predicted A 560, true G predicted K 1,279, true K predicted G 856.

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.


Where the errors are​

Result​

In the reference run, the two largest off-diagonal cells of the confusion matrix are G predicted as F and F predicted as G, and F and G have the lowest F1 scores of the five classes. The errors are between neighbours in the temperature sequence: G stars are otherwise confused with K, F stars with A, and almost never with distant types.

Interpretation​

Spectral types are bins cut into a continuous temperature sequence. Near the F/G boundary, consecutive subtypes (late F, early G) differ by small changes in line strengths, so a spectrum close to the cut can carry the label of either side. Errors that stay between adjacent classes are the pattern expected from a classifier that has learned the ordering of the sequence; random errors would spread over all classes.

Caveat​

The labels are the LAMOST pipeline types, not an independent reference. Part of the F/G "errors" may therefore come from the labels themselves; the exported results do not allow separating classifier errors from label noise.

◎
Confusion matrix (row-normalised)
G2 · v6
Confusion matrix (row-normalised)
G2 · reference run v6 · test set — includes Gaia/photometric features (Data Leakage Audit)

Which features separate F from G​

Result​

The per-class SHAP attribution of the reference run (logs/shap/features_20260522T153123Z/01_data_leak/) ranks different features at the top for the two classes. For F, the leading features are the Mg b equivalent width, the Na D equivalent width and the continuum curvature. For G, the Mg I 5184 Å equivalent width, the CNO index and the Hα/Hβ equivalent-width ratio lead. The leading features of F and G have smaller mean |SHAP| values than those of A, K and M.

Interpretation​

Between F and G, the classifier relies on a combination of moderate signals — the growth of metal lines (Mg b, Na D) and the weakening of the Balmer lines as temperature decreases — rather than on one decisive line. A spread of small contributions is consistent with a boundary that is defined by gradual changes.

Caveat​

The per-class ranking is read from the figure produced by the pipeline (mean |SHAP| per class); the per-class values are not part of the exported CSV. The SHAP run analyses a model that includes Gaia/photometric features.

◎
Top features per class
G2 · v6
Top features per class
G2 · SHAP of run v6 (01_data_leak) — mean |SHAP| per class
◎
Beeswarm per class
G2 · v6
Beeswarm per class
G2 · SHAP of run v6 (01_data_leak) — direction of each feature effect

The transition zone in UMAP (PHY-3500 · G1 · 43,019 spectra)​

This section uses a different dataset and an older model: predictions of the XGBoost run v5 (ST_100k_xgb_AFGKM_v5) projected onto the UMAP embedding of the PHY-3500 dataset.

Result. Spectra whose predicted type differs between F and G concentrate along the zone where the F and G populations meet in the embedding, not in isolated islands.

Interpretation. The unsupervised embedding, built without labels, places these spectra between the two populations: the ambiguity is present in the features themselves, not introduced by the classifier.

Caveat. Qualitative, on G1 and with model v5 (which also includes a Gaia-derived column, M_G); it illustrates the mechanism but is not a measurement on the reference run.

◎
F/G confusion in UMAP
G1 · v5
F/G confusion in UMAP
PHY-3500 · G1 · 43,019 spectra — model v5 predictions projected

Limitations of this result​

  • No independent reference classification (another survey or manual typing) is part of the exported results, so the share of label noise in the F/G errors is unknown.
  • The analysis is at the level of main types; the subtype of misclassified spectra (late F vs early G) is not exported.
  • All G2 numbers come from a run whose features include Gaia/photometric columns.