# jeonjas25/talus architecture

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

- Interactive diagram: https://gitdiagram.com/jeonjas25/talus
- Repository: https://github.com/jeonjas25/talus

## Overview

Talus is a Washington State landslide-susceptibility modeling project: geospatial covariates and landslide labels become a cleaned sample matrix, which is trained and evaluated with watershed-based spatial folds and a separate Oso holdout. The final model also predicts statewide raster risk, which feeds SHAP interpretation and map products. The README describes upstream geospatial preparation and sampling, but the tree contains no source for those steps; those inputs are shown without invented internal processing links.

Main entry points: [`src/save_model.py`](https://github.com/jeonjas25/talus/blob/main/src/save_model.py) (Model and metrics), [`src/full_map.py`](https://github.com/jeonjas25/talus/blob/main/src/full_map.py) (Statewide prediction), [`src/shap_analysis.py`](https://github.com/jeonjas25/talus/blob/main/src/shap_analysis.py) (SHAP analysis), [`src/final_train.py`](https://github.com/jeonjas25/talus/blob/main/src/final_train.py) (Oso evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Geospatial inputs"]
  node_sources(("Geospatial sources"))
  node_raw_samples["Sample matrix"]
  node_cleaner["Matrix cleaning<br/>[cleaner.py]"]
  node_clean_matrix["Clean matrix"]
  node_folds["Spatial folds"]
  node_oso_holdout["Oso holdout"]
  node_rasters["Aligned feature rasters"]
end

subgraph group_modeling["Modeling and evaluation"]
  node_train["Spatial CV<br/>[train.py]"]
  node_tune1["Tune weighting"]
  node_tune2["Tune depth and rate"]
  node_tune3["Tune estimators"]
  node_final_train["Oso evaluation<br/>[final_train.py]"]
  node_save_model["Model and metrics<br/>[save_model.py]"]
  node_model_file["Saved XGBoost model<br/>[xgb_final.json]"]
  node_metrics["Evaluation metrics"]
end

subgraph group_products["Risk products"]
  node_full_map["Statewide prediction<br/>[full_map.py]"]
  node_risk_raster["Susceptibility raster"]
  node_site["Interactive map<br/>[make_site.py]"]
  node_map_html["Susceptibility map"]
  node_figure_maker["Static map figures<br/>[figure_maker.py]"]
end

subgraph group_interpretation["Interpretation"]
  node_shap["SHAP analysis<br/>[shap_analysis.py]"]
  node_figures["Risk and SHAP figures"]
end

node_sources -.->|"inform inputs"| node_raw_samples
node_raw_samples -->|"loads"| node_cleaner
node_cleaner -->|"writes"| node_clean_matrix
node_clean_matrix -->|"loads"| node_train
node_folds -->|"loads"| node_train
node_clean_matrix -->|"loads"| node_tune1
node_folds -->|"loads"| node_tune1
node_clean_matrix -->|"loads"| node_tune2
node_folds -->|"loads"| node_tune2
node_clean_matrix -->|"loads"| node_tune3
node_folds -->|"loads"| node_tune3
node_clean_matrix -->|"loads"| node_final_train
node_folds -->|"loads"| node_final_train
node_oso_holdout -->|"evaluates"| node_final_train
node_clean_matrix -->|"loads"| node_save_model
node_folds -->|"loads"| node_save_model
node_oso_holdout -->|"evaluates"| node_save_model
node_save_model -->|"writes"| node_model_file
node_save_model -->|"writes"| node_metrics
node_clean_matrix -->|"loads"| node_full_map
node_folds -->|"loads"| node_full_map
node_rasters -->|"reads"| node_full_map
node_full_map -->|"writes"| node_risk_raster
node_clean_matrix -->|"loads"| node_shap
node_folds -->|"loads"| node_shap
node_shap -->|"writes"| node_figures
node_risk_raster -->|"reads"| node_site
node_site -->|"writes"| node_map_html
node_risk_raster -->|"reads"| node_figure_maker
node_figure_maker -->|"writes"| node_figures

click node_cleaner "https://github.com/jeonjas25/talus/blob/main/src/cleaner.py"
click node_train "https://github.com/jeonjas25/talus/blob/main/src/train.py"
click node_tune1 "https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_one.py"
click node_tune2 "https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_two.py"
click node_tune3 "https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_three.py"
click node_final_train "https://github.com/jeonjas25/talus/blob/main/src/final_train.py"
click node_save_model "https://github.com/jeonjas25/talus/blob/main/src/save_model.py"
click node_model_file "https://github.com/jeonjas25/talus/blob/main/outputs/models/xgb_final.json"
click node_metrics "https://github.com/jeonjas25/talus/tree/main/outputs/models"
click node_full_map "https://github.com/jeonjas25/talus/blob/main/src/full_map.py"
click node_shap "https://github.com/jeonjas25/talus/blob/main/src/shap_analysis.py"
click node_figures "https://github.com/jeonjas25/talus/tree/main/outputs/figures"
click node_site "https://github.com/jeonjas25/talus/blob/main/src/make_site.py"
click node_map_html "https://github.com/jeonjas25/talus/blob/main/outputs/maps/susceptibility_map.html"
click node_figure_maker "https://github.com/jeonjas25/talus/blob/main/src/figure_maker.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_sources,node_raw_samples,node_cleaner,node_clean_matrix,node_folds,node_oso_holdout,node_rasters toneBlue
class node_train,node_tune1,node_tune2,node_tune3,node_final_train,node_save_model,node_model_file,node_metrics toneAmber
class node_full_map,node_risk_raster,node_site,node_map_html,node_figure_maker toneMint
class node_shap,node_figures toneRose
```

## Components

### Geospatial inputs

- **Geospatial sources**
- **Sample matrix**
- [Matrix cleaning](https://github.com/jeonjas25/talus/blob/main/src/cleaner.py): `src/cleaner.py`
- **Clean matrix**
- **Spatial folds**
- **Oso holdout**
- **Aligned feature rasters**

### Modeling and evaluation

- [Spatial CV](https://github.com/jeonjas25/talus/blob/main/src/train.py): `src/train.py`
- [Tune weighting](https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_one.py): `src/tuning_phase_one.py`
- [Tune depth and rate](https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_two.py): `src/tuning_phase_two.py`
- [Tune estimators](https://github.com/jeonjas25/talus/blob/main/src/tuning_phase_three.py): `src/tuning_phase_three.py`
- [Oso evaluation](https://github.com/jeonjas25/talus/blob/main/src/final_train.py): `src/final_train.py`
- [Model and metrics](https://github.com/jeonjas25/talus/blob/main/src/save_model.py): `src/save_model.py`
- [Saved XGBoost model](https://github.com/jeonjas25/talus/blob/main/outputs/models/xgb_final.json): `outputs/models/xgb_final.json`
- [Evaluation metrics](https://github.com/jeonjas25/talus/tree/main/outputs/models): `outputs/models`

### Risk products

- [Statewide prediction](https://github.com/jeonjas25/talus/blob/main/src/full_map.py): `src/full_map.py`
- **Susceptibility raster**
- [Interactive map](https://github.com/jeonjas25/talus/blob/main/src/make_site.py): `src/make_site.py`
- [Susceptibility map](https://github.com/jeonjas25/talus/blob/main/outputs/maps/susceptibility_map.html): `outputs/maps/susceptibility_map.html`
- [Static map figures](https://github.com/jeonjas25/talus/blob/main/src/figure_maker.py): `src/figure_maker.py`

### Interpretation

- [SHAP analysis](https://github.com/jeonjas25/talus/blob/main/src/shap_analysis.py): `src/shap_analysis.py`
- [Risk and SHAP figures](https://github.com/jeonjas25/talus/tree/main/outputs/figures): `outputs/figures`

## Connections

- Geospatial sources → Sample matrix: inform inputs
- Sample matrix → Matrix cleaning: loads
- Matrix cleaning → Clean matrix: writes
- Clean matrix → Spatial CV: loads
- Spatial folds → Spatial CV: loads
- Clean matrix → Tune weighting: loads
- Spatial folds → Tune weighting: loads
- Clean matrix → Tune depth and rate: loads
- Spatial folds → Tune depth and rate: loads
- Clean matrix → Tune estimators: loads
- Spatial folds → Tune estimators: loads
- Clean matrix → Oso evaluation: loads
- Spatial folds → Oso evaluation: loads
- Oso holdout → Oso evaluation: evaluates
- Clean matrix → Model and metrics: loads
- Spatial folds → Model and metrics: loads
- Oso holdout → Model and metrics: evaluates
- Model and metrics → Saved XGBoost model: writes
- Model and metrics → Evaluation metrics: writes
- Clean matrix → Statewide prediction: loads
- Spatial folds → Statewide prediction: loads
- Aligned feature rasters → Statewide prediction: reads
- Statewide prediction → Susceptibility raster: writes
- Clean matrix → SHAP analysis: loads
- Spatial folds → SHAP analysis: loads
- SHAP analysis → Risk and SHAP figures: writes
- Susceptibility raster → Interactive map: reads
- Interactive map → Susceptibility map: writes
- Susceptibility raster → Static map figures: reads
- Static map figures → Risk and SHAP figures: writes
