Package: ggRandomForests 4.0.0

ggRandomForests: Visually Exploring Random Forests

Graphic elements for exploring Random Forests using 'randomForestSRC' and 'randomForest' for survival, regression, and classification forests, and 'varPro' for rule-based variable priority. Suggests 'randomForestRHF' for hazards with time-dependent covariates. Implements visualizations of the methods described in Breiman (2001) <doi:10.1023/A:1010933404324>, Ishwaran, Kogalur, Blackstone, and Lauer (2008) <doi:10.1214/08-AOAS169>, Lu and Ishwaran (2024) <doi:10.48550/arXiv.2409.09003>, and Ishwaran, Hsich, Kogalur, and Lee (2026) <doi:10.48550/arXiv.2608.21597>.

Authors:John Ehrlinger [aut, cre]

ggRandomForests_4.0.0.tar.gz
ggRandomForests_4.0.0.zip(r-4.7-any)ggRandomForests_4.0.0.zip(r-4.6-any)ggRandomForests_4.0.0.zip(r-4.5-any)
ggRandomForests_4.0.0.tgz(r-4.6-any)ggRandomForests_4.0.0.tgz(r-4.5-any)
ggRandomForests_4.0.0.tar.gz(r-4.7-any)ggRandomForests_4.0.0.tar.gz(r-4.6-any)
ggRandomForests_4.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
ggRandomForests/json (API)

# Install 'ggRandomForests' in R:
install.packages('ggRandomForests', repos = c('https://ehrlinger.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ehrlinger/ggrandomforests/issues

Pkgdown/docs site:https://ehrlinger.github.io

On CRAN:

Conda:

quarto

11.28 score 154 stars 277 scripts 917 downloads 16 mentions 35 exports 83 dependencies

Last updated from:94b57b7a33. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK263
source / vignettesOK378
linux-releaseOK249
macos-releaseOK231
macos-oldrelOK254
windows-develOK268
windows-releaseOK276
windows-oldrelOK253
wasm-releaseOK143

Exports:calc_auccalc_rocgg_ale_rfsrcgg_auctgg_beta_uvarprogg_beta_varprogg_briergg_errorgg_isoprogg_ivarprogg_partialgg_partial_rfsrcgg_partial_varprogg_partialprogg_rfsrcgg_rhfgg_rhf_importancegg_rocgg_sdependentgg_shapgg_survivalgg_tune_rhfgg_udependentgg_variablegg_varprogg_vimpkaplannelsonquantile_ptsshap_beeswarmshap_dependenceshap_importancesurv_partial.rfsrcvarpro_coveragevarpro_feature_names

Dependencies:BARTbase64encbitbit64bslibcachemclicliprcodetoolscpp11crayondata.treeDiagrammeRdigestdplyrevaluatefarverfastmapfontawesomeforeachfsgbmgenericsggplot2glmnetgluegtablehighrhmshtmltoolshtmlwidgetsigraphisobanditeratorsjquerylibjsonliteknitrlabelinglatticelifecyclemagrittrMatrixmemoisemimenlmepatchworkpillarpkgconfigprettyunitsprogresspurrrR6randomForestrandomForestSRCrappdirsRColorBrewerRcppRcppEigenreadrrlangrmarkdownrstudioapiS7sassscalesshapestringistringrsurvivaltibbletidyrtidyselecttinytextzdbutf8varProvctrsviridisLitevisNetworkvroomwithrxfunyaml

Exploring variable importance with varPro
What varPro is | Regression: Boston housing | Per-tree importance with gg_varpro() | Partial dependence with gg_partial_varpro() | Per-rule lasso refinement with gg_beta_varpro() | Unsupervised views: see the uvarpro vignette | Anomaly scoring with gg_isopro() | Local importance with gg_ivarpro() | Classification: iris | Class-conditional importance with gg_varpro(conditional = TRUE) | Partial dependence: gg_partial_varpro() on classification | Per-class lasso refinement with gg_beta_varpro() | Survival: PBC | Variable importance: gg_varpro() | Partial dependence: gg_partial_varpro() on survival | Anomaly scoring: gg_isopro() on the X-matrix | Not available for survival: gg_beta_varpro, gg_ivarpro | Small or sparse data | Cross-cutting reference | Family-support matrix | Which variables can you actually get? | Factor-level ordering | Caching the expensive calls | Provenance shape | Further reading | References

Last update: 2026-10-15
Started: 2026-05-28

varPro on small or sparse data
The data | Which variables did varPro test? | What does a z of zero mean? | Reading the importance plot | How much do the settings matter? | Checking against noise | A screen or a selection? | Partial dependence on small data | References

Last update: 2026-10-15
Started: 2026-10-15

Explaining a forest: five views of a variable's effect
What does this variable do? | The data, and a forest | What the data alone shows | Averaging over everything else: partial dependence | The neighborhood that doesn't exist | How different are they, really? | Where two variables act together | One prediction at a time | Local by construction | Two estimands that are easy to confuse | Which one do you reach for? | What is not here | References

Last update: 2026-09-29
Started: 2026-09-09

Random Forest Survival Analysis with ggRandomForests
Work in progress | Introduction | Data: Primary Biliary Cirrhosis (PBC) | Data cleaning | Exploratory data analysis | Kaplan--Meier survival by treatment | Growing a Random Survival Forest | OOB error convergence | OOB predicted survival | Test set predictions | Variable Selection | Variable importance (VIMP) | Minimal depth | Variable Dependence | Variable dependence plots | Partial dependence | Conditional dependence | Partial Dependence Surfaces | Brier Score and CRPS | Conclusion | References

Last update: 2026-09-25
Started: 2026-03-28

Random Forest Regression with ggRandomForests
Work in progress | Introduction | Data: Boston Housing Values | Exploratory data analysis | Growing a Random Forest | OOB error convergence | OOB predictions | Variable Selection | Variable importance (VIMP) | Minimal depth | SHAP Analysis | SHAP importance | SHAP beeswarm | SHAP dependence | Variable Dependence | Variable dependence plots | Partial dependence | Variable Interactions and Conditioning Plots | Conditioning on a categorical variable | Conditioning on a continuous variable | Partial Dependence Surface | Conclusion | References

Last update: 2026-09-11
Started: 2026-03-28

Exploring Random Forests with ggRandomForests
Error trajectories with gg_error() | Marginal dependence via gg_variable() | Variable importance with gg_vimp() | Balanced conditioning cuts with quantile_pts() | Next steps

Last update: 2026-09-11
Started: 2026-02-20

Random Forest Classification with ggRandomForests
Work in progress | Introduction | Data: Iris Flower Measurements | Exploratory data analysis | Growing a Random Forest | OOB error convergence | OOB predictions | Variable Selection | Variable importance (VIMP) | Minimal depth | SHAP Analysis | SHAP importance | SHAP beeswarm | SHAP dependence | Variable Dependence | Variable dependence plots | Partial dependence | Classification Performance: ROC and AUC | Conclusion | References

Last update: 2026-09-11
Started: 2026-07-13

Random Hazard Forests with ggRandomForests
What changes with counting-process data? | Where did the fitted objects come from? | How do hazard and cumulative hazard differ? | Hazard is local | Why do the hazard curves stop early? | Cumulative hazard adds the local rates | How does discrimination change over time? | Cumulative/dynamic AUC uses cumulative hazard | Incident/dynamic AUC uses hazard | Which variables matter, and when? | Which tree size did the upstream searches select? | OOB risk tuning | OOB iAUC tuning | What does each extractor return? | How can this analysis be reproduced? | Further reading

Last update: 2026-09-11
Started: 2026-08-26

Variable selection without an outcome: unsupervised varPro
Importance without a response | One fit, three views | What depends on what: gg_udependent() | What ranks highest: gg_beta_uvarpro() | Where to draw the line: gg_sdependent() | Reading the three together | References

Last update: 2026-09-11
Started: 2026-07-01

Readme and manuals

Help Manual

Help pageTopics
ggRandomForests: Visually Exploring Random ForestsggRandomForests-package
'autoplot' methods for 'ggRandomForests' data objectsautoplot.gg autoplot.gg_ale_interaction autoplot.gg_ale_rfsrc autoplot.gg_auct autoplot.gg_brier autoplot.gg_error autoplot.gg_isopro autoplot.gg_partial autoplot.gg_partialpro autoplot.gg_partial_rfsrc autoplot.gg_partial_varpro autoplot.gg_rfsrc autoplot.gg_rhf autoplot.gg_rhf_importance autoplot.gg_roc autoplot.gg_shap autoplot.gg_survival autoplot.gg_tune_rhf autoplot.gg_udependent autoplot.gg_variable autoplot.gg_varpro autoplot.gg_vimp
Area Under the ROC Curve calculatorcalc_auc calc_auc.gg_roc
Receiver Operator Characteristic calculatorcalc_roc calc_roc.randomForest calc_roc.rfsrc
Accumulated Local Effects (ALE) data from an rfsrc modelgg_ale_rfsrc
Tidy time-varying AUC from a Random Hazard Forestgg_auct gg_auct.rhf
Per-variable lasso-beta importance from an unsupervised varPro fitgg_beta_uvarpro
Per-variable lasso-beta importance from a varPro fitgg_beta_varpro
Brier score and CRPS for survival forestsgg_brier
Random forest error trajectory data objectgg_error gg_error.randomForest gg_error.randomForest.formula gg_error.rfsrc
Tidy data from a varPro isolation-forest fitgg_isopro
Individual (local) variable importance from a varPro fitgg_ivarpro
Split partial dependence data into continuous or categorical datasetsgg_partial
Partial dependence data from an rfsrc modelgg_partial_rfsrc
Partial dependence data from a varPro modelgg_partialpro gg_partial_varpro
Predicted response data objectgg_rfsrc gg_rfsrc.rfsrc
Tidy hazard and cumulative-hazard curves from a Random Hazard Forestgg_rhf gg_rhf.rhf
Tidy time-localized variable priority from a Random Hazard Forestgg_rhf_importance gg_rhf_importance.rhf
ROC (Receiver Operating Characteristic) curve data from a classification forest.gg_roc gg_roc.randomForest gg_roc.rfsrc
Signal-variable detection from an unsupervised varPro fitgg_sdependent
SHAP (Shapley additive explanations) data objectgg_shap gg_shap.randomForest gg_shap.rfsrc
Nonparametric survival estimates.gg_survival gg_survival.default gg_survival.rfsrc
Tidy a Random Hazard Forest tuning pathgg_tune_rhf gg_tune_rhf.tune.treesize.rhf
Variable dependency graph from a uvarpro modelgg_udependent
Marginal variable dependence data object.gg_variable gg_variable.random gg_variable.randomForest gg_variable.rfsrc
Variable importance data from a varPro modelgg_varpro
Variable Importance (VIMP) data objectgg_vimp gg_vimp.randomForest gg_vimp.randomForest.formula gg_vimp.rfsrc
nonparametric Kaplan-Meier estimateskaplan
nonparametric Nelson-Aalen estimatesnelson
Plot a 'gg_ale_rfsrc' interaction objectplot.gg_ale_interaction
Plot a 'gg_ale_rfsrc' objectplot.gg_ale_rfsrc
Plot a time-varying AUC curveplot.gg_auct
Plot a 'gg_beta_uvarpro' objectplot.gg_beta_uvarpro
Plot a 'gg_beta_varpro' objectplot.gg_beta_varpro
Plot a 'gg_brier' objectplot.gg_brier
Plot a 'gg_error' objectplot.gg_error
Plot a varPro isolation-forest anomaly scoreplot.gg_isopro
Plot a 'gg_ivarpro' objectplot.gg_ivarpro
Plot a 'gg_partial' objectplot.gg_partial
Plot a 'gg_partial_rfsrc' objectplot.gg_partial_rfsrc
Plot a 'gg_partial_varpro' objectplot.gg_partialpro plot.gg_partial_varpro
Predicted response plot from a 'gg_rfsrc' object.plot.gg_rfsrc
Plot Random Hazard Forest hazard / cumulative-hazard curvesplot.gg_rhf
Plot Random Hazard Forest variable priority over timeplot.gg_rhf_importance
ROC plot generic function for a 'gg_roc' object.plot.gg_roc
Plot a 'gg_sdependent' objectplot.gg_sdependent
Plot a 'gg_shap' objectplot.gg_shap
Plot a 'gg_survival' object.plot.gg_survival
Plot a Random Hazard Forest tuning pathplot.gg_tune_rhf
Plot a 'gg_udependent' variable dependency graphplot.gg_udependent
Plot a 'gg_variable' object,plot.gg_variable
Plot a 'gg_varpro' variable importance objectplot.gg_varpro
Plot a 'gg_vimp' object, extracted variable importance of a 'rfsrc' objectplot.gg_vimp
Print methods for gg_* data objectsprint.gg print.gg_ale_interaction print.gg_ale_rfsrc print.gg_auct print.gg_beta_uvarpro print.gg_beta_varpro print.gg_brier print.gg_error print.gg_isopro print.gg_ivarpro print.gg_partial print.gg_partialpro print.gg_partial_rfsrc print.gg_partial_varpro print.gg_rfsrc print.gg_rhf print.gg_rhf_importance print.gg_roc print.gg_sdependent print.gg_shap print.gg_survival print.gg_tune_rhf print.gg_udependent print.gg_variable print.gg_varpro print.gg_vimp print.summary.gg_udependent
Quantile-based cut points for coplotsquantile_pts
SHAP beeswarm summary plotshap_beeswarm
SHAP dependence plotshap_dependence
SHAP global importance bar chartshap_importance
Summary methods for gg_* data objectsprint.summary.gg summary.gg summary.gg_ale_interaction summary.gg_ale_rfsrc summary.gg_auct summary.gg_beta_uvarpro summary.gg_beta_varpro summary.gg_brier summary.gg_error summary.gg_isopro summary.gg_ivarpro summary.gg_partial summary.gg_partialpro summary.gg_partial_rfsrc summary.gg_partial_varpro summary.gg_rfsrc summary.gg_rhf summary.gg_rhf_importance summary.gg_roc summary.gg_sdependent summary.gg_shap summary.gg_survival summary.gg_tune_rhf summary.gg_udependent summary.gg_variable summary.gg_varpro summary.gg_vimp
Survival partial dependence data for one or more predictorssurv_partial.rfsrc
How well a varpro fit tested each variablevarpro_coverage
Recover original variable names from varpro one-hot encoded feature namesvarpro_feature_names