# muhammadmoaz/st1capstoneproj architecture

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

- Interactive diagram: https://gitdiagram.com/muhammadmoaz/st1capstoneproj
- Repository: https://github.com/muhammadmoaz/st1capstoneproj

## Overview

This is a country-continent prediction project: a training script explores country GDP and population data, trains and evaluates classifiers, and saves an XGBoost model. Users can enter those features in either a Flask web form or a Tkinter desktop tool and receive a predicted continent. The source excerpts show these paths and the model artifact; the template contents and CSV schema were not sampled.

Main entry points: [`WebTool.py`](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/WebTool.py) (Web predictor), [`best_model.pkl`](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/best_model.pkl) (Trained model), [`main.py`](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py) (Data exploration), [`templates/index.html`](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/templates/index.html) (Prediction form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_exploration["Data exploration<br/>[main.py]"]
  node_preparation["Feature preparation<br/>[main.py]"]
  node_evaluation["Model evaluation<br/>[main.py]"]
  node_model["Trained model<br/>[best_model.pkl]"]
end

subgraph group_interfaces["Prediction interfaces"]
  node_web["Web predictor<br/>[WebTool.py]"]
  node_webpage["Prediction form<br/>[index.html]"]
  node_desktop["Desktop predictor<br/>[DesktopTool.py]"]
end

node_user(("User"))
node_dataset["Country dataset<br/>[countries.csv]"]

node_dataset -->|"read by"| node_exploration
node_exploration -->|"feeds"| node_preparation
node_preparation -->|"trains and tests"| node_evaluation
node_evaluation -->|"saves"| node_model
node_user -->|"submits features"| node_web
node_web -->|"renders"| node_webpage
node_webpage -->|"posts features"| node_web
node_web -->|"loads and predicts"| node_model
node_user -->|"enters features"| node_desktop
node_desktop -->|"loads and predicts"| node_model

click node_dataset "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/countries.csv"
click node_exploration "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py"
click node_preparation "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py"
click node_evaluation "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py"
click node_model "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/best_model.pkl"
click node_web "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/WebTool.py"
click node_webpage "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/templates/index.html"
click node_desktop "https://github.com/muhammadmoaz/st1capstoneproj/blob/main/DesktopTool.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_exploration,node_preparation,node_evaluation,node_model,node_user toneBlue
class node_web,node_webpage,node_desktop toneAmber
class node_dataset toneTeal
```

## Components

### Model training

- [Data exploration](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py): `main.py`
- [Feature preparation](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py): `main.py`
- [Model evaluation](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/main.py): `main.py`
- [Trained model](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/best_model.pkl): `best_model.pkl`

### Prediction interfaces

- [Web predictor](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/WebTool.py): `WebTool.py`
- [Prediction form](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/templates/index.html): `templates/index.html`
- [Desktop predictor](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/DesktopTool.py): `DesktopTool.py`

### Other components

- **User**
- [Country dataset](https://github.com/muhammadmoaz/st1capstoneproj/blob/main/countries.csv): `countries.csv`

## Connections

- Country dataset → Data exploration: read by (evidence: `main.py`)
- Data exploration → Feature preparation: feeds (evidence: `main.py`)
- Feature preparation → Model evaluation: trains and tests (evidence: `main.py`)
- Model evaluation → Trained model: saves (evidence: `main.py`)
- User → Web predictor: submits features (evidence: `WebTool.py`)
- Web predictor → Prediction form: renders (evidence: `WebTool.py`)
- Prediction form → Web predictor: posts features (evidence: `WebTool.py`)
- Web predictor → Trained model: loads and predicts (evidence: `WebTool.py`)
- User → Desktop predictor: enters features (evidence: `DesktopTool.py`)
- Desktop predictor → Trained model: loads and predicts (evidence: `DesktopTool.py`)
