Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LauraSilRu/exoplanet-profiler/llms.txt
Use this file to discover all available pages before exploring further.
Each ExoProfiler notebook exposes a small set of configuration constants at the top of the file. These control data paths, feature selection, preprocessing parameters, and clustering behavior. Modifying these values changes the pipeline’s behavior globally within a notebook run.
Notebook 03 — Preprocessing Parameters
The following constants govern how raw TESS data is transformed into the clean feature matrix consumed by PCA.
| Parameter | Default | Description |
|---|
FEATURE_COLUMNS | list of 12 | Canonical feature order for all downstream artifacts |
MIN_PRESENT_FEATURES | 8 | Minimum features observed per planet to be retained |
LOG1P_FEATURES | list of 6 | Variables to transform with log1p |
N_NEIGHBORS | 5 | KNNImputer neighbors |
KNN_WEIGHTS | 'distance' | KNNImputer weighting scheme |
SCALER | 'robust' | Scaler type (RobustScaler) |
INPUT_PATH | data/raw/exoplanets.csv | Raw input data path |
OUTPUT_PATH | data/processed/exoplanets_preprocessed.csv | Preprocessed output path |
The FEATURE_COLUMNS list defines the canonical order that all downstream artifacts — the pipeline joblib, PCA scores, and cluster assignments — must respect:
FEATURE_COLUMNS = [
'pl_orbper',
'pl_orbsmax',
'pl_rade',
'pl_bmasse',
'pl_orbeccen',
'pl_insol',
'pl_eqt',
'st_teff',
'st_rad',
'st_mass',
'st_met',
'st_logg',
]
The LOG1P_FEATURES subset identifies the six positively skewed variables that receive a log1p(x) transformation before scaling:
LOG1P_FEATURES = [
'pl_orbper',
'pl_orbsmax',
'pl_rade',
'pl_bmasse',
'pl_insol',
'st_rad',
]
pl_orbeccen is excluded from log transformation because it is bounded between 0 and 1. st_logg is excluded because it already represents a logarithmic magnitude.
Notebook 04 — PCA Parameters
These constants control the PCA dimensionality reduction step. Most defaults should only be changed when intentionally exploring alternative pipeline configurations.
| Parameter | Default | Description |
|---|
USE_DEMO_DATA | False | Use synthetic demo data instead of real preprocessed data |
PROCESSED_DATA_PATH | data/processed/exoplanets_preprocessed.csv | Input path |
DATA_ALREADY_SCALED | True | Skip re-scaling (data was already scaled in notebook 03) |
VARIANCE_THRESHOLD | 0.85 | Minimum cumulative variance to retain |
RANDOM_STATE | 42 | Reproducibility seed for PCA |
USE_DEMO_DATA = False
PROCESSED_DATA_PATH = Path('data/processed/exoplanets_preprocessed.csv')
DATA_ALREADY_SCALED = True
VARIANCE_THRESHOLD = 0.85
Never set DATA_ALREADY_SCALED = False unless re-running from scratch without notebook 03’s output. Double-scaling will apply RobustScaler a second time to already-scaled data, distorting PCA loadings and making results incomparable to the published artifacts.
Notebook 05 — Clustering Parameters
These constants define the K-Means sweep range, the selected cluster count, and the paths used to read PCA scores and write the final labeled dataset.
| Parameter | Default | Description |
|---|
K_RANGE | range(2, 11) | K values to evaluate in the sweep |
SELECTED_K | 2 | Final K-Means cluster count |
RANDOM_STATE | 42 | Primary random seed |
STABILITY_SEEDS | [10, 100, 2026, 9999] | Seeds for stability validation |
PCA_SCORES_PATH | data/processed/pca/pca_scores.csv | Input: PCA component scores |
OUTPUT_PATH | data/processed/clustered_exoplanets.csv | Final labeled output |
SELECTED_K = 2 is the value that produced the highest Silhouette coefficient (0.4950) across the full sweep from K=2 to K=10. The stability validation confirmed 99.04%–100.00% assignment consistency across the four STABILITY_SEEDS.
Changing the Variance Threshold
If you lower VARIANCE_THRESHOLD to 0.75, the pipeline will select 3 components, which capture 83.62% of total variance. This will change the K-Means input matrix from shape (731, 4) to (731, 3) and may alter cluster assignments. After any threshold change, re-run notebooks 04 and 05 sequentially to regenerate consistent artifacts.
The relationship between threshold and component count for the current 731-planet dataset is:
| Threshold | Components Selected | Cumulative Variance |
|---|
| 0.75 | 3 | 83.62% |
| 0.85 | 4 | 90.35% (default) |
| 0.90 | 4 | 90.35% |
Note that both the 0.85 and 0.90 thresholds resolve to the same 4-component solution, because PC4 pushes cumulative variance to 90.35% in a single step past both thresholds.
Reproducibility
Setting random_state=42 throughout ensures deterministic results across all pipeline stages. The stability analysis in notebook 05 confirmed that K=2 assignments are 99%–100% consistent across four stability seeds (10, 100, 2026, 9999), so the choice of seed has negligible impact on cluster composition.