Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

prepare.ggplot.shap.data

Combine and melt feature values and SHAP contributions for sample observations.


Description

Conforms to data format required for ggplot functions.

Usage

prepare.ggplot.shap.data(data_list, normalize = FALSE)

Arguments

data_list

List containing 'data' and 'shap_contrib' returned by xgb.shap.data().

normalize

Whether to standardize feature values to have mean 0 and standard deviation 1 (useful for comparing multiple features on the same plot). Default FALSE.

Details

Internal utility function.

Value

A data.table containing the observation ID, the feature name, the feature value (normalized if specified), and the SHAP contribution value.


xgboost

Extreme Gradient Boosting

v1.4.1.1
Apache License (== 2.0) | file LICENSE
Authors
Tianqi Chen [aut], Tong He [aut, cre], Michael Benesty [aut], Vadim Khotilovich [aut], Yuan Tang [aut] (<https://orcid.org/0000-0001-5243-233X>), Hyunsu Cho [aut], Kailong Chen [aut], Rory Mitchell [aut], Ignacio Cano [aut], Tianyi Zhou [aut], Mu Li [aut], Junyuan Xie [aut], Min Lin [aut], Yifeng Geng [aut], Yutian Li [aut], XGBoost contributors [cph] (base XGBoost implementation)
Initial release
2021-04-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.