# cygubicko/satpred architecture

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

- Interactive diagram: https://gitdiagram.com/cygubicko/satpred
- Repository: https://github.com/cygubicko/satpred

## Overview

satpred is an R package for training, predicting with, and assessing survival models. Its documented workflow tunes a random survival forest, fits the selected model, then derives individual survival curves, concordance, and permutation variable importance. The tree also shows model-specific implementations and time-dependent assessment modules. No source excerpts were provided, so connections beyond the workflow explicitly demonstrated in the README are omitted.

Main entry points: [`R/mod_train.R`](https://github.com/cygubicko/satpred/blob/master/R/mod_train.R) (Fit model), [`R/mod_cv.R`](https://github.com/cygubicko/satpred/blob/master/R/mod_cv.R) (Tune model), [`R/posthocfuns.R`](https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R) (Individual curves)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Model workflow"]
  node_tune["Tune model<br/>[mod_cv.R]"]
  node_fit["Fit model<br/>[mod_train.R]"]
end

subgraph group_models["Survival models"]
  node_rfsrc["Survival forest"]
  node_gbm["Boosted trees<br/>[gbm_satpred.R]"]
  node_deepsurv["Survival network<br/>[deepsurv_satpred.R]"]
  node_coxph["Cox model<br/>[coxph_satpred.R]"]
end

subgraph group_assessment["Assessment and outputs"]
  node_curves["Individual curves<br/>[posthocfuns.R]"]
  node_concordance["Concordance<br/>[posthocfuns.R]"]
  node_importance["Variable importance<br/>[posthocfuns.R]"]
  node_tdauc["Time-dependent AUC<br/>[tdcauc.R]"]
  node_tdroc["Time-dependent ROC<br/>[tdcroc.R]"]
  node_brier["Brier score<br/>[ibrierscore.R]"]
  node_plots["Plots<br/>[satpredplots.R]"]
end

node_user(("Analyst"))

node_user -->|"tunes"| node_tune
node_tune -->|"provides fit"| node_fit
node_user -->|"requests curves"| node_curves
node_fit -->|"derives curves"| node_curves
node_user -->|"requests score"| node_concordance
node_fit -->|"scores model"| node_concordance
node_user -->|"requests importance"| node_importance
node_fit -->|"measures importance"| node_importance

click node_tune "https://github.com/cygubicko/satpred/blob/master/R/mod_cv.R"
click node_fit "https://github.com/cygubicko/satpred/blob/master/R/mod_train.R"
click node_rfsrc "https://github.com/cygubicko/satpred/tree/master/R"
click node_gbm "https://github.com/cygubicko/satpred/blob/master/R/gbm_satpred.R"
click node_deepsurv "https://github.com/cygubicko/satpred/blob/master/R/deepsurv_satpred.R"
click node_coxph "https://github.com/cygubicko/satpred/blob/master/R/coxph_satpred.R"
click node_curves "https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R"
click node_concordance "https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R"
click node_importance "https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R"
click node_tdauc "https://github.com/cygubicko/satpred/blob/master/R/tdcauc.R"
click node_tdroc "https://github.com/cygubicko/satpred/blob/master/R/tdcroc.R"
click node_brier "https://github.com/cygubicko/satpred/blob/master/R/ibrierscore.R"
click node_plots "https://github.com/cygubicko/satpred/blob/master/R/satpredplots.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_tune,node_fit toneBlue
class node_rfsrc,node_gbm,node_deepsurv,node_coxph toneAmber
class node_curves,node_concordance,node_importance,node_tdauc,node_tdroc,node_brier,node_plots toneMint
class node_user toneIndigo
```

## Components

### Model workflow

- [Tune model](https://github.com/cygubicko/satpred/blob/master/R/mod_cv.R): `R/mod_cv.R`
- [Fit model](https://github.com/cygubicko/satpred/blob/master/R/mod_train.R): `R/mod_train.R`

### Survival models

- [Survival forest](https://github.com/cygubicko/satpred/tree/master/R): `R`
- [Boosted trees](https://github.com/cygubicko/satpred/blob/master/R/gbm_satpred.R): `R/gbm_satpred.R`
- [Survival network](https://github.com/cygubicko/satpred/blob/master/R/deepsurv_satpred.R): `R/deepsurv_satpred.R`
- [Cox model](https://github.com/cygubicko/satpred/blob/master/R/coxph_satpred.R): `R/coxph_satpred.R`

### Assessment and outputs

- [Individual curves](https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R): `R/posthocfuns.R`
- [Concordance](https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R): `R/posthocfuns.R`
- [Variable importance](https://github.com/cygubicko/satpred/blob/master/R/posthocfuns.R): `R/posthocfuns.R`
- [Time-dependent AUC](https://github.com/cygubicko/satpred/blob/master/R/tdcauc.R): `R/tdcauc.R`
- [Time-dependent ROC](https://github.com/cygubicko/satpred/blob/master/R/tdcroc.R): `R/tdcroc.R`
- [Brier score](https://github.com/cygubicko/satpred/blob/master/R/ibrierscore.R): `R/ibrierscore.R`
- [Plots](https://github.com/cygubicko/satpred/blob/master/R/satpredplots.R): `R/satpredplots.R`

### Other components

- **Analyst**

## Connections

- Analyst → Tune model: tunes (evidence: `README.md`)
- Tune model → Fit model: provides fit (evidence: `README.md`)
- Analyst → Individual curves: requests curves (evidence: `README.md`)
- Fit model → Individual curves: derives curves (evidence: `README.md`)
- Analyst → Concordance: requests score (evidence: `README.md`)
- Fit model → Concordance: scores model (evidence: `README.md`)
- Analyst → Variable importance: requests importance (evidence: `README.md`)
- Fit model → Variable importance: measures importance (evidence: `README.md`)
