Package: SHAPforxgboost 0.1.3

SHAPforxgboost: SHAP Plots for 'XGBoost'

Aid in visual data investigations using SHAP (SHapley Additive exPlanation) visualization plots for 'XGBoost' and 'LightGBM'. It provides summary plot, dependence plot, interaction plot, and force plot and relies on the SHAP implementation provided by 'XGBoost' and 'LightGBM'. Please refer to 'slundberg/shap' for the original implementation of SHAP in 'Python'.

Authors:Yang Liu [aut, cre], Allan Just [aut, ctb], Michael Mayer [ctb]

SHAPforxgboost_0.1.3.tar.gz
SHAPforxgboost_0.1.3.zip(r-4.5)SHAPforxgboost_0.1.3.zip(r-4.4)SHAPforxgboost_0.1.3.zip(r-4.3)
SHAPforxgboost_0.1.3.tgz(r-4.5-any)SHAPforxgboost_0.1.3.tgz(r-4.4-any)SHAPforxgboost_0.1.3.tgz(r-4.3-any)
SHAPforxgboost_0.1.3.tar.gz(r-4.5-noble)SHAPforxgboost_0.1.3.tar.gz(r-4.4-noble)
SHAPforxgboost_0.1.3.tgz(r-4.4-emscripten)SHAPforxgboost_0.1.3.tgz(r-4.3-emscripten)
SHAPforxgboost.pdf |SHAPforxgboost.html
SHAPforxgboost/json (API)
NEWS

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

Bug tracker:https://github.com/liuyanguu/shapforxgboost/issues

Datasets:
  • dataXY_df - Terra satellite data (X,Y) for running the xgboost model .
  • labels_within_package - Labels_within_package: Some labels package auther defined to make his plot, mainly serve the paper publication.
  • shap_int_iris - The interaction effect SHAP values example using iris dataset.
  • shap_long_iris - The long-format SHAP values example using iris dataset.
  • shap_score - SHAP values example from dataXY_df .
  • shap_values_iris - SHAP values example using iris dataset.

On CRAN:

8.86 score 110 stars 1 packages 284 scripts 1.7k downloads 3 mentions 13 exports 113 dependencies

Last updated 11 months agofrom:46cbbc2036. Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKFeb 15 2025
R-4.5-winOKFeb 15 2025
R-4.5-macOKFeb 15 2025
R-4.5-linuxOKFeb 15 2025
R-4.4-winOKFeb 15 2025
R-4.4-macOKFeb 15 2025
R-4.3-winOKFeb 15 2025
R-4.3-macOKFeb 15 2025

Exports:scatter.plot.diagonalscatter.plot.simpleshap.importanceshap.plot.dependenceshap.plot.force_plotshap.plot.force_plot_bygroupshap.plot.summaryshap.plot.summary.wrap1shap.plot.summary.wrap2shap.prepshap.prep.interactionshap.prep.stack.datashap.values

Dependencies:abindbackportsbase64encBBmiscbootbroombslibcachemcarcarDatacheckmateclicolorspacecolourpickercommonmarkcorrplotcowplotcpp11crayondata.tableDerivdigestdoBydplyrevaluatefansifarverfastmapfontawesomeFormulafsgenericsggExtraggforceggplot2ggpubrggrepelggsciggsignifgluegridExtragtablehighrhtmltoolshtmlwidgetshttpuvisobandjquerylibjsonliteknitrlabelinglaterlatticelifecyclelme4magrittrMASSMatrixMatrixModelsmemoisemgcvmicrobenchmarkmimeminiUIminqamodelrmunsellnlmenloptrnnetnumDerivpbkrtestpillarpkgconfigpolyclippolynompromisespurrrquantregR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRdpackreformulasrlangrmarkdownrstatixsassscalesshinyshinyjssourcetoolsSparseMstringistringrsurvivalsystemfontstibbletidyrtidyselecttinytextweenrutf8vctrsviridisLitewithrxfunxgboostxtableyaml

Basic Workflow

Rendered frombasic_workflow.Rmdusingknitr::rmarkdownon Feb 15 2025.

Last update: 2022-05-18
Started: 2021-03-26

Readme and manuals

Help Manual

Help pageTopics
Terra satellite data (X,Y) for running the xgboost model .dataXY_df
Modify labels for features under plottinglabel.feature
labels_within_package: Some labels package auther defined to make his plot, mainly serve the paper publication.labels_within_package
new_labels: a place holder default to NULL.new_labels
Internal-function to revise axis label for each featureplot.label
Make customized scatter plot with diagonal line and R2 printed.scatter.plot.diagonal
Simple scatter plot, adding marginal histogram by default.scatter.plot.simple
The interaction effect SHAP values example using iris dataset.shap_int_iris
The long-format SHAP values example using iris dataset.shap_long_iris
SHAP values example from dataXY_df .shap_score
SHAP values example using iris dataset.shap_values_iris
Variable importance as measured by mean absolute SHAP value.shap.importance
SHAP dependence plot and interaction plot, optional to be colored by a selected featureshap.plot.dependence
Make the SHAP force plotshap.plot.force_plot
Make the stack plot, optional to zoom in at certain x or certain clustershap.plot.force_plot_bygroup
SHAP summary plot core function using the long format SHAP valuesshap.plot.summary
A wrapped function to make summary plot from model object and predictorsshap.plot.summary.wrap1
A wrapped function to make summary plot from given SHAP values matrixshap.plot.summary.wrap2
Prepare SHAP values into long format for plottingshap.prep
Prepare the interaction SHAP values from predict.xgb.Boostershap.prep.interaction
Prepare data for SHAP force plot (stack plot)shap.prep.stack.data
Get SHAP scores from a trained XGBoost or LightGBM modelshap.values