# simondedman/gbm.auto architecture

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

- Interactive diagram: https://gitdiagram.com/simondedman/gbm.auto
- Repository: https://github.com/simondedman/gbm.auto

## Overview

gbm.auto is an R package for automated boosted-regression-tree abundance modelling, evaluation, and spatial decision support. Its principal workflow is to evaluate parameter combinations, select and simplify a model, produce predictions and diagnostics, and optionally map predictions and representativeness. The README documents several companion workflows for conservation, protected-area planning, and prediction variability. Source excerpts were unavailable, so relationships below rely on README statements rather than inspected call sites.

Main entry points: [`R/gbm.auto.R`](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.auto.R) (Automated BRT), [`R/gbm.map.R`](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.map.R) (Prediction maps), [`R/gbm.loop.R`](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.loop.R) (Prediction variability), [`R/gbm.cons.R`](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.cons.R) (Conservation mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Modeling workflow"]
  node_gbm_auto["Automated BRT<br/>[gbm.auto.R]"]
  node_model_eval["Model evaluation<br/>[gbm.step.sd.R]"]
  node_loop["Prediction variability<br/>[gbm.loop.R]"]
  node_bfcheck["Bag-fraction check<br/>[gbm.bfcheck.R]"]
  node_results["Model outputs<br/>[gbm.auto.R]"]
end

subgraph group_spatial["Spatial analysis"]
  node_basemap["Basemap creation<br/>[gbm.basemap.R]"]
  node_prediction_maps["Prediction maps<br/>[gbm.map.R]"]
  node_rsb["Representativeness surfaces<br/>[gbm.rsb.R]"]
end

subgraph group_decision["Decision support"]
  node_conservation["Conservation mapping<br/>[gbm.cons.R]"]
  node_value_map["Protected-area planning<br/>[gbm.valuemap.R]"]
end

subgraph group_diagnostics["Plots and evaluation"]
  node_roc["ROC and calibration<br/>[roc.R]"]
  node_calibration["Calibration<br/>[calibration.R]"]
  node_plots["Model plots<br/>[gbm.factorplot.R]"]
  node_lmplots["Predictor plots<br/>[gbm.lmplots.R]"]
end

node_user(("Analyst"))
node_gbm_dismo["gbm and dismo"]

node_user -->|"runs model"| node_gbm_auto
node_gbm_auto -->|"automates processes"| node_gbm_dismo
node_gbm_auto -->|"checks bag fraction"| node_bfcheck
node_gbm_auto -->|"evaluates model"| node_model_eval
node_gbm_auto -->|"uses metrics"| node_roc
node_gbm_auto -->|"uses metrics"| node_calibration
node_gbm_auto -->|"generates plots"| node_plots
node_gbm_auto -->|"produces outputs"| node_results
node_gbm_auto -->|"optionally maps"| node_prediction_maps
node_gbm_auto -->|"optionally builds"| node_rsb
node_user -->|"creates basemap"| node_basemap
node_user -->|"maps predictions"| node_prediction_maps
node_prediction_maps -->|"plots surfaces"| node_rsb
node_user -->|"runs subsets"| node_conservation
node_conservation -->|"runs models"| node_gbm_auto
node_user -->|"plans protected areas"| node_value_map
node_user -->|"runs prediction loops"| node_loop
node_loop -->|"repeats parameters"| node_gbm_auto
node_user -->|"plots predictors"| node_lmplots

click node_gbm_auto "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.auto.R"
click node_model_eval "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.step.sd.R"
click node_roc "https://github.com/simondedman/gbm.auto/blob/master/R/roc.R"
click node_calibration "https://github.com/simondedman/gbm.auto/blob/master/R/calibration.R"
click node_plots "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.factorplot.R"
click node_lmplots "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.lmplots.R"
click node_basemap "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.basemap.R"
click node_prediction_maps "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.map.R"
click node_rsb "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.rsb.R"
click node_conservation "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.cons.R"
click node_value_map "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.valuemap.R"
click node_loop "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.loop.R"
click node_bfcheck "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.bfcheck.R"
click node_results "https://github.com/simondedman/gbm.auto/blob/master/R/gbm.auto.R"

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_gbm_auto,node_model_eval,node_loop,node_bfcheck,node_results toneBlue
class node_basemap,node_prediction_maps,node_rsb toneAmber
class node_conservation,node_value_map toneMint
class node_roc,node_calibration,node_plots,node_lmplots toneRose
class node_user,node_gbm_dismo toneIndigo
```

## Components

### Modeling workflow

- [Automated BRT](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.auto.R): `R/gbm.auto.R`
- [Model evaluation](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.step.sd.R): `R/gbm.step.sd.R`
- [Prediction variability](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.loop.R): `R/gbm.loop.R`
- [Bag-fraction check](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.bfcheck.R): `R/gbm.bfcheck.R`
- [Model outputs](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.auto.R): `R/gbm.auto.R`

### Spatial analysis

- [Basemap creation](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.basemap.R): `R/gbm.basemap.R`
- [Prediction maps](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.map.R): `R/gbm.map.R`
- [Representativeness surfaces](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.rsb.R): `R/gbm.rsb.R`

### Decision support

- [Conservation mapping](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.cons.R): `R/gbm.cons.R`
- [Protected-area planning](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.valuemap.R): `R/gbm.valuemap.R`

### Plots and evaluation

- [ROC and calibration](https://github.com/simondedman/gbm.auto/blob/master/R/roc.R): `R/roc.R`
- [Calibration](https://github.com/simondedman/gbm.auto/blob/master/R/calibration.R): `R/calibration.R`
- [Model plots](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.factorplot.R): `R/gbm.factorplot.R`
- [Predictor plots](https://github.com/simondedman/gbm.auto/blob/master/R/gbm.lmplots.R): `R/gbm.lmplots.R`

### Other components

- **Analyst**
- **gbm and dismo**

## Connections

- Analyst → Automated BRT: runs model (evidence: `README.md`)
- Automated BRT → gbm and dismo: automates processes (evidence: `README.md`)
- Automated BRT → Bag-fraction check: checks bag fraction (evidence: `README.md`)
- Automated BRT → Model evaluation: evaluates model (evidence: `README.md`)
- Automated BRT → ROC and calibration: uses metrics (evidence: `README.md`)
- Automated BRT → Calibration: uses metrics (evidence: `README.md`)
- Automated BRT → Model plots: generates plots (evidence: `README.md`)
- Automated BRT → Model outputs: produces outputs (evidence: `README.md`)
- Automated BRT → Prediction maps: optionally maps (evidence: `README.md`)
- Automated BRT → Representativeness surfaces: optionally builds (evidence: `README.md`)
- Analyst → Basemap creation: creates basemap (evidence: `README.md`)
- Analyst → Prediction maps: maps predictions (evidence: `README.md`)
- Prediction maps → Representativeness surfaces: plots surfaces (evidence: `README.md`)
- Analyst → Conservation mapping: runs subsets (evidence: `README.md`)
- Conservation mapping → Automated BRT: runs models (evidence: `README.md`)
- Analyst → Protected-area planning: plans protected areas (evidence: `README.md`)
- Analyst → Prediction variability: runs prediction loops (evidence: `README.md`)
- Prediction variability → Automated BRT: repeats parameters (evidence: `README.md`)
- Analyst → Predictor plots: plots predictors (evidence: `README.md`)
