# soumajit11/cosmic-classifier architecture

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

- Interactive diagram: https://gitdiagram.com/soumajit11/cosmic-classifier
- Repository: https://github.com/soumajit11/cosmic-classifier

## Overview

Cosmic Classifier is a Streamlit planetary-habitability explorer: users configure ten telemetry values, receive a model classification, and inspect charts or export the inputs. The dashboard entry point loads the serialized classifier and routes landing, input, and report views. The README also documents a notebook-based training and model-export workflow. Training internals and some report-view code are not sampled; those documented capabilities are represented at the notebook level, without assuming unseen implementation details.

Main entry points: [`src/views.py`](https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py) (Page views), [`app.py`](https://github.com/soumajit11/cosmic-classifier/blob/main/app.py) (App router), [`decision_tree_model.pkl`](https://github.com/soumajit11/cosmic-classifier/blob/main/decision_tree_model.pkl) (Habitability classifier), [`model.ipynb`](https://github.com/soumajit11/cosmic-classifier/blob/main/model.ipynb) (Training workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_notebook["Training workflow<br/>[model.ipynb]"]
  node_training_data["Planetary datasets"]
end

subgraph group_dashboard["Dashboard flow"]
  node_app["App router<br/>[app.py]"]
  node_views["Page views<br/>[views.py]"]
  node_model_utils["Model utilities<br/>[model_utils.py]"]
  node_classifier["Habitability classifier"]
  node_inference["Live inference<br/>[views.py]"]
  node_csv_export["CSV export<br/>[views.py]"]
end

subgraph group_presentation["Reports and presentation"]
  node_styles["Theme styling<br/>[styles.py]"]
  node_prediction_card["Classification details<br/>[model_utils.py]"]
  node_charts["Telemetry charts<br/>[charts.py]"]
end

node_user(("Explorer"))

node_user -->|"uses dashboard"| node_app
node_app -->|"loads styling"| node_styles
node_app -->|"loads model"| node_model_utils
node_model_utils -->|"loads pickle"| node_classifier
node_app -->|"routes pages"| node_views
node_views -->|"predicts"| node_inference
node_inference -->|"runs model"| node_classifier
node_views -->|"renders result"| node_prediction_card
node_views -->|"builds charts"| node_charts
node_views -->|"creates download"| node_csv_export
node_user -->|"downloads CSV"| node_csv_export
node_training_data -->|"supplies data"| node_notebook
node_notebook -->|"trains and saves"| node_classifier

click node_app "https://github.com/soumajit11/cosmic-classifier/blob/main/app.py"
click node_styles "https://github.com/soumajit11/cosmic-classifier/blob/main/src/styles.py"
click node_views "https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py"
click node_model_utils "https://github.com/soumajit11/cosmic-classifier/blob/main/src/model_utils.py"
click node_classifier "https://github.com/soumajit11/cosmic-classifier/blob/main/decision_tree_model.pkl"
click node_inference "https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py"
click node_prediction_card "https://github.com/soumajit11/cosmic-classifier/blob/main/src/model_utils.py"
click node_charts "https://github.com/soumajit11/cosmic-classifier/blob/main/src/charts.py"
click node_csv_export "https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py"
click node_notebook "https://github.com/soumajit11/cosmic-classifier/blob/main/model.ipynb"

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_notebook,node_training_data toneBlue
class node_app,node_views,node_model_utils,node_classifier,node_inference,node_csv_export toneAmber
class node_styles,node_prediction_card,node_charts toneMint
class node_user toneIndigo
```

## Components

### Model training

- [Training workflow](https://github.com/soumajit11/cosmic-classifier/blob/main/model.ipynb): `model.ipynb`
- **Planetary datasets**

### Dashboard flow

- [App router](https://github.com/soumajit11/cosmic-classifier/blob/main/app.py): `app.py`
- [Page views](https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py): `src/views.py`
- [Model utilities](https://github.com/soumajit11/cosmic-classifier/blob/main/src/model_utils.py): `src/model_utils.py`
- [Habitability classifier](https://github.com/soumajit11/cosmic-classifier/blob/main/decision_tree_model.pkl): `decision_tree_model.pkl`
- [Live inference](https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py): `src/views.py`
- [CSV export](https://github.com/soumajit11/cosmic-classifier/blob/main/src/views.py): `src/views.py`

### Reports and presentation

- [Theme styling](https://github.com/soumajit11/cosmic-classifier/blob/main/src/styles.py): `src/styles.py`
- [Classification details](https://github.com/soumajit11/cosmic-classifier/blob/main/src/model_utils.py): `src/model_utils.py`
- [Telemetry charts](https://github.com/soumajit11/cosmic-classifier/blob/main/src/charts.py): `src/charts.py`

### Other components

- **Explorer**

## Connections

- Explorer → App router: uses dashboard
- App router → Theme styling: loads styling
- App router → Model utilities: loads model
- Model utilities → Habitability classifier: loads pickle
- App router → Page views: routes pages
- Page views → Live inference: predicts
- Live inference → Habitability classifier: runs model
- Page views → Classification details: renders result
- Page views → Telemetry charts: builds charts
- Page views → CSV export: creates download
- Explorer → CSV export: downloads CSV
- Planetary datasets → Training workflow: supplies data
- Training workflow → Habitability classifier: trains and saves
