# ercecchi-jpg/dsci-521-group-project architecture

> Architecture diagram of the GitHub repository ercecchi-jpg/dsci-521-group-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ercecchi-jpg/dsci-521-group-project
- Repository: https://github.com/ercecchi-jpg/dsci-521-group-project

## Overview

This project turns historical U.S. accident data into an XGBoost severity classifier, then predicts severity for a user-selected airport using current METAR weather. The documented workflow covers cleaning, exploration, training, prediction, and GUI demonstration; the standalone GUI loads local model artifacts and location data, fetches METAR, prepares model features, and displays severity probabilities and weather. Notebook internals are not sampled, so their workflow links rely on the README; the GUI’s detailed call sequence is only partially visible.

Main entry points: [`app/gui.py`](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py) (Tkinter application), [`data/processed`](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/processed) (Processed accidents), [`model_artifacts`](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/model_artifacts) (Model artifacts), [`notebooks/01_data_cleaning.ipynb`](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/01_data_cleaning.ipynb) (Data cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preparation["Data preparation"]
  node_rawdata[("Accident dataset")]
  node_cleaning["Data cleaning"]
  node_processed[("Processed accidents")]
  node_eda["Exploratory analysis<br/>[02_eda.ipynb]"]
end

subgraph group_modeling["Model development"]
  node_training["XGBoost training"]
  node_artifacts[("Model artifacts")]
  node_predictionnotebook["Notebook prediction"]
  node_guiwalkthrough["GUI demonstration"]
end

subgraph group_runtime["Prediction application"]
  node_gui["Tkinter application<br/>[gui.py]"]
  node_locations[("Location lookup data")]
  node_metar["METAR feature preparation<br/>[gui.py]"]
  node_classifier["Severity classifier<br/>[gui.py]"]
  node_results["Severity and weather results<br/>[gui.py]"]
end

node_user(("User"))
node_weatherapi{{"Aviation Weather API"}}

node_rawdata -->|"provides data"| node_cleaning
node_cleaning -->|"generates dataset"| node_processed
node_processed -->|"explored in"| node_eda
node_processed -->|"trains on"| node_training
node_training -->|"exports model"| node_artifacts
node_artifacts -->|"used by"| node_predictionnotebook
node_predictionnotebook -->|"demonstrated by"| node_guiwalkthrough
node_user -->|"selects location"| node_gui
node_gui -->|"loads locations"| node_locations
node_gui -->|"prepares features"| node_metar
node_metar -->|"requests observations"| node_weatherapi
node_gui -->|"predicts severity"| node_classifier
node_classifier -->|"loads model"| node_artifacts
node_gui -->|"displays prediction"| node_results

click node_rawdata "https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/raw"
click node_cleaning "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/01_data_cleaning.ipynb"
click node_processed "https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/processed"
click node_eda "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/02_eda.ipynb"
click node_training "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/03_model_training.ipynb"
click node_artifacts "https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/model_artifacts"
click node_predictionnotebook "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/04_prediction.ipynb"
click node_guiwalkthrough "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/05_gui_prediction.ipynb"
click node_gui "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py"
click node_locations "https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/processed"
click node_metar "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py"
click node_classifier "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py"
click node_results "https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py"

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_rawdata,node_cleaning,node_processed,node_eda,node_user toneBlue
class node_training,node_artifacts,node_predictionnotebook,node_guiwalkthrough toneAmber
class node_gui,node_locations,node_metar,node_classifier,node_results,node_weatherapi toneMint
```

## Components

### Data preparation

- [Accident dataset](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/raw): `data/raw`
- [Data cleaning](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/01_data_cleaning.ipynb): `notebooks/01_data_cleaning.ipynb`
- [Processed accidents](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/processed): `data/processed`
- [Exploratory analysis](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/02_eda.ipynb): `notebooks/02_eda.ipynb`

### Model development

- [XGBoost training](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/03_model_training.ipynb): `notebooks/03_model_training.ipynb`
- [Model artifacts](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/model_artifacts): `model_artifacts`
- [Notebook prediction](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/04_prediction.ipynb): `notebooks/04_prediction.ipynb`
- [GUI demonstration](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/notebooks/05_gui_prediction.ipynb): `notebooks/05_gui_prediction.ipynb`

### Prediction application

- [Tkinter application](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py): `app/gui.py`
- [Location lookup data](https://github.com/ercecchi-jpg/dsci-521-group-project/tree/main/data/processed): `data/processed`
- [METAR feature preparation](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py): `app/gui.py`
- [Severity classifier](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py): `app/gui.py`
- [Severity and weather results](https://github.com/ercecchi-jpg/dsci-521-group-project/blob/main/app/gui.py): `app/gui.py`

### Other components

- **User**
- **Aviation Weather API**

## Connections

- Accident dataset → Data cleaning: provides data (evidence: `README.md`)
- Data cleaning → Processed accidents: generates dataset (evidence: `README.md`)
- Processed accidents → Exploratory analysis: explored in (evidence: `README.md`)
- Processed accidents → XGBoost training: trains on (evidence: `README.md`)
- XGBoost training → Model artifacts: exports model (evidence: `README.md`)
- Model artifacts → Notebook prediction: used by (evidence: `README.md`)
- Notebook prediction → GUI demonstration: demonstrated by (evidence: `README.md`)
- User → Tkinter application: selects location (evidence: `README.md`)
- Tkinter application → Location lookup data: loads locations (evidence: `app/gui.py`)
- Tkinter application → METAR feature preparation: prepares features (evidence: `README.md`)
- METAR feature preparation → Aviation Weather API: requests observations (evidence: `app/gui.py`)
- Tkinter application → Severity classifier: predicts severity (evidence: `README.md`)
- Severity classifier → Model artifacts: loads model (evidence: `app/gui.py`)
- Tkinter application → Severity and weather results: displays prediction (evidence: `README.md`)
