text
stringlengths
0
107
```python
import polars as pl
from astropy.table import Table
# Load FITS as Astropy Table, convert to Polars
table = Table.read('stars_types_with_best4_predictions.fits')
df = pl.from_pandas(table.to_pandas())
# Filter high-quality predictions
high_quality = df.filter(
pl.col('quality_flag').is_in(['A', 'B'])
)
# Analyze by source
source_summary = df.group_by('teff_source').agg([
pl.count().alias('count'),
pl.col('teff_final').mean().alias('mean_teff')
])
```
## Quality Recommendations
**For scientific analysis**:
- **Best quality**: Use quality_flag == 'A' (Gaia only) for highest reliability
- **Good quality**: Use quality_flag <= 'B' (Gaia + low-uncertainty ML) for larger sample
- **Acceptable**: Use quality_flag <= 'C' for exploratory analysis
**For specific temperature ranges**:
- Cool stars (<5000 K): Quality B-C recommended (ML performs well)
- Hot stars (>6000 K): Quality A-B recommended (Gaia more reliable)
**For uncertainty-aware analysis**:
- Always propagate `teff_uncertainty` when available
- Gaia temperatures (quality_flag='A') have no formal uncertainties but are generally reliable
## Methodology
### Best-of-Four Ensemble
For each object, four ML models were evaluated:
1. **Teff Only** (Gaia photometry)
- Features: g, BP, RP, BP-RP
- Predicts: Corrected Teff (polynomial correction for T>10000K)
- Uncertainty: Random Forest tree variance (full 300 trees)
2. **Teff with log(g)** (Gaia photometry + surface gravity)
- Features: g, BP, RP, BP-RP, log(g)
- Uncertainty propagation: Numerical gradient method
- Combined uncertainty: RF + log(g) contribution in quadrature
3. **Teff with Clustering** (Gaia photometry + cluster probabilities)
- Features: g, BP, RP, BP-RP + cluster membership probabilities
- K-means clustering in color-magnitude space
- Uncertainty: Random Forest tree variance
4. **Teff Flag 1** (Gaia photometry, high-quality training)
- Features: g, BP, RP, BP-RP
- Training: Only Gaia GSP-Phot flag 1 sources (highest quality)
- Corrected Teff target with polynomial correction
- Uncertainty: Random Forest tree variance (full 300 trees)
**Selection criteria**: For each object, the model with the lowest uncertainty was selected.
This approach maximizes the number of high-confidence predictions while maintaining accuracy.
**Improvement**: Mean uncertainty reduced by 22.8% compared to best-of-three (263K → 203K).
### Training Data
- **Source**: Gaia DR3 GSP-Phot temperatures (high-quality subsample)
- **Size**: ~700,000 eclipsing binaries with reliable Teff
- **Filters**: Quality flag filtering, outlier removal, photometric quality cuts
- **Model**: Random Forest Regressor (300 trees)
- **Validation**: Cross-validation on held-out test set
## References
- **Gaia DR3**: https://www.cosmos.esa.int/web/gaia/dr3
- **GSP-Phot**: Gaia Spectro-Photometric analysis pipeline
- **Best-of-Four Methodology**: See `reports/figures/best_of_four_ensemble/`
## Contact
For questions or issues with this catalog, please contact the repository maintainer.
## Version History
- **v2.0** (2025-12-18): Best-of-four ensemble with flag 1 model (22.8% improvement)
- **v1.0** (2025-11-20): Initial release with best-of-three ensemble predictions
Unified Photometry Dataset Summary
================================================================================
Created: 2025-11-04 14:05:33
File: eb_unified_photometry.parquet
Size: 251.9 MB
Total sources: 2,184,477
Total columns: 36