Astrophage

Astrophage is a wildly fast exoplanet classification engine I wrote in Rust. It leans heavily on Polars and a custom Two-Stage Random Forest setup to categorize Kepler Objects of Interest (KOIs) as either Confirmed, Candidate, or False Positive.
Check out the project on GitHub | Read the documentation
Why “Two-Stage”?
NASA doesn’t just dump all their data into a single bucket to guess exoplanet statuses, so our model shouldn’t either. Instead of forcing one massive Random Forest to learn three separate classes at once, I broke the architecture down into two clean binary decisions:
- Stage 1: Is it CONFIRMED or NOT CONFIRMED?
- Stage 2: If it’s not confirmed, is it a CANDIDATE or a FALSE POSITIVE?
This might sound like extra work, but it actually boosts overall accuracy by about 3-4%. The model learns much cleaner decision boundaries when it only has to pick between two things at a time. The end result? We hit 94.81% accuracy.
The Hard Numbers
| Metric | Score |
|---|---|
| Accuracy | 94.81% |
| Macro F1 | 92.64% |
| Weighted F1 | 94.51% |
Under the Hood
I wanted this thing to scream, so I built it on a heavily optimized stack:
- Rust: Because I wanted memory safety without the GC overhead, plus SIMD optimizations essentially for free.
- Polars: The absolute king of dataframes right now. It chews through CSV I/O and columnar operations instantly.
- NDArray: My go-to for vectorized math and handling the N-Dimensional arrays.
- Tokio: Running the async runtime to keep everything non-blocking.