# fjaellet/xgboost_chem_ages architecture

> Architecture diagram of the GitHub repository fjaellet/xgboost_chem_ages, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fjaellet/xgboost_chem_ages
- Repository: https://github.com/fjaellet/xgboost_chem_ages

## Overview

This repository publishes spectroscopic age estimates for APOGEE DR17 red-giant stars, produced by training XGBoost on stars with asteroseismic ages and applying the model to APOGEE data. Its documented workflow also includes independent catalogue comparisons and age–chemokinematics analyses. The README describes these notebook workflows and the published catalogue; only `py/utils.py` was sampled, so implementation details and notebook-to-notebook calls are not verified.

Main entry points: [`py/train_xgboost_miglio2021.ipynb`](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021.ipynb) (XGBoost age training), [`py/train_xgboost_miglio2021_quantileregression.ipynb`](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021_quantileregression.ipynb) (Quantile age training), [`data/spec_ages_published.fits`](https://github.com/fjaellet/xgboost_chem_ages/blob/main/data/spec_ages_published.fits) (Published age catalogue), [`py/test_age_catalogues.ipynb`](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/test_age_catalogues.ipynb) (Age catalogue comparisons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_age_estimation["Age estimation"]
  node_training_data[("Asteroseismic training data")]
  node_apogee_data[("APOGEE DR17 data")]
  node_standard_training["XGBoost age training"]
  node_quantile_training["Quantile age training"]
  node_saved_models[("Trained models")]
  node_published_catalogue[("Published age catalogue")]
end

subgraph group_catalog_validation["Catalogue validation"]
  node_comparison_data[("Independent age datasets")]
  node_catalogue_comparisons["Age catalogue comparisons"]
end

subgraph group_science_analysis["Science analysis"]
  node_science_data[("Age analysis data")]
  node_science_tests["Age–chemokinematics analysis"]
  node_analysis_utilities["Analysis utilities<br/>[utils.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs training"| node_standard_training
node_researcher -->|"runs training"| node_quantile_training
node_standard_training -->|"uses training set"| node_training_data
node_standard_training -->|"predicts ages"| node_apogee_data
node_quantile_training -->|"uses training set"| node_training_data
node_quantile_training -->|"predicts ages"| node_apogee_data
node_standard_training -->|"trains XGBoost"| node_saved_models
node_standard_training -->|"produces catalogue"| node_published_catalogue
node_quantile_training -->|"produces estimates"| node_published_catalogue
node_researcher -->|"runs comparisons"| node_catalogue_comparisons
node_catalogue_comparisons -->|"compares estimates"| node_published_catalogue
node_catalogue_comparisons -->|"compares against"| node_comparison_data
node_researcher -->|"runs analysis"| node_science_tests
node_science_tests -->|"analyses ages"| node_published_catalogue
node_science_tests -->|"analyses relations"| node_science_data

click node_training_data "https://github.com/fjaellet/xgboost_chem_ages/tree/main/data"
click node_apogee_data "https://github.com/fjaellet/xgboost_chem_ages/tree/main/data"
click node_standard_training "https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021.ipynb"
click node_quantile_training "https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021_quantileregression.ipynb"
click node_saved_models "https://github.com/fjaellet/xgboost_chem_ages/tree/main/py/models"
click node_published_catalogue "https://github.com/fjaellet/xgboost_chem_ages/blob/main/data/spec_ages_published.fits"
click node_comparison_data "https://github.com/fjaellet/xgboost_chem_ages/tree/main/data"
click node_catalogue_comparisons "https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/test_age_catalogues.ipynb"
click node_science_data "https://github.com/fjaellet/xgboost_chem_ages/tree/main/data"
click node_science_tests "https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/test_ages_science.ipynb"
click node_analysis_utilities "https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_training_data,node_apogee_data,node_standard_training,node_quantile_training,node_saved_models,node_published_catalogue toneBlue
class node_comparison_data,node_catalogue_comparisons toneAmber
class node_science_data,node_science_tests,node_analysis_utilities toneMint
class node_researcher toneIndigo
```

## Components

### Age estimation

- [Asteroseismic training data](https://github.com/fjaellet/xgboost_chem_ages/tree/main/data): `data`
- [APOGEE DR17 data](https://github.com/fjaellet/xgboost_chem_ages/tree/main/data): `data`
- [XGBoost age training](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021.ipynb): `py/train_xgboost_miglio2021.ipynb`
- [Quantile age training](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/train_xgboost_miglio2021_quantileregression.ipynb): `py/train_xgboost_miglio2021_quantileregression.ipynb`
- [Trained models](https://github.com/fjaellet/xgboost_chem_ages/tree/main/py/models): `py/models`
- [Published age catalogue](https://github.com/fjaellet/xgboost_chem_ages/blob/main/data/spec_ages_published.fits): `data/spec_ages_published.fits`

### Catalogue validation

- [Independent age datasets](https://github.com/fjaellet/xgboost_chem_ages/tree/main/data): `data`
- [Age catalogue comparisons](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/test_age_catalogues.ipynb): `py/test_age_catalogues.ipynb`

### Science analysis

- [Age analysis data](https://github.com/fjaellet/xgboost_chem_ages/tree/main/data): `data`
- [Age–chemokinematics analysis](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/test_ages_science.ipynb): `py/test_ages_science.ipynb`
- [Analysis utilities](https://github.com/fjaellet/xgboost_chem_ages/blob/main/py/utils.py): `py/utils.py`

### Other components

- **Researcher**

## Connections

- Researcher → XGBoost age training: runs training (evidence: `README.md`)
- Researcher → Quantile age training: runs training (evidence: `README.md`)
- XGBoost age training → Asteroseismic training data: uses training set (evidence: `README.md`)
- XGBoost age training → APOGEE DR17 data: predicts ages (evidence: `README.md`)
- Quantile age training → Asteroseismic training data: uses training set (evidence: `README.md`)
- Quantile age training → APOGEE DR17 data: predicts ages (evidence: `README.md`)
- XGBoost age training → Trained models: trains XGBoost (evidence: `README.md`)
- XGBoost age training → Published age catalogue: produces catalogue (evidence: `README.md`)
- Quantile age training → Published age catalogue: produces estimates (evidence: `README.md`)
- Researcher → Age catalogue comparisons: runs comparisons (evidence: `README.md`)
- Age catalogue comparisons → Published age catalogue: compares estimates (evidence: `README.md`)
- Age catalogue comparisons → Independent age datasets: compares against (evidence: `README.md`)
- Researcher → Age–chemokinematics analysis: runs analysis (evidence: `README.md`)
- Age–chemokinematics analysis → Published age catalogue: analyses ages (evidence: `README.md`)
- Age–chemokinematics analysis → Age analysis data: analyses relations (evidence: `README.md`)
