Views
No views yet
| Metric | Test Set |
|---|---|
| Accuracy | 89.10% |
| F1 (weighted) | 89.03% |
| Precision (weighted) | 89.03% |
| Recall (weighted) | 89.10% |
| Loss | 0.2804 |
1import torch
2import numpy as np
3from huggingface_hub import hf_hub_download
4from safetensors.torch import load_file
5
6# 1. Download and load model
7model_path = hf_hub_download("sarojpatil16/exoplanet-transit-detector", "model.safetensors")
8
9# 2. Recreate architecture (copy from this model card or train.py)
10# ... (see model architecture code below) ...
11# model = AstroNetCNN(n_scalars=9, num_classes=3)
12# model.load_state_dict(load_file(model_path))
13# model.eval()
14
15# 3. Prepare inputs from light curve data
16# flux_global: (1, 201) - phase-folded full light curve, median-subtracted & MAD-normalized
17# flux_local: (1, 81) - zoomed transit view
18# flux_odd: (1, 201) - odd-numbered transits
19# flux_even: (1, 201) - even-numbered transits
20# scalars: (1, 9) - [period_days, duration_hrs, depth_ppm, teff, logg, radius, mass, metallicity, kepmag]
21# (period, duration, depth are log1p-transformed)
22
23# 4. Predict
24# with torch.no_grad():
25# output = model(flux_global, flux_local, flux_odd, flux_even, scalars)
26# probabilities = torch.softmax(output.logits, dim=-1)
27# pred_class = torch.argmax(output.logits, dim=-1)
28# # 0=PLANET, 1=FALSE_POSITIVE, 2=NO_SIGNAL| Class ID | Label | Description |
|---|---|---|
| 0 | PLANET | Confirmed or candidate exoplanet transit |
| 1 | FALSE_POSITIVE | Signal is not a planet (eclipsing binary, stellar variability, etc.) |
| 2 | NO_SIGNAL | No significant transit signal detected |