plot_shap_scatter | R Documentation |
This function plots a scatter of the contribution (Shapley values) of a feature against the value of that feature for each sample.
plot_shap_scatter(
model,
name,
model_data,
n_features = 4,
n_columns = 2,
overlay_predictions = FALSE,
sample_names = NULL,
remove_prefix = TRUE,
sample_colors = NULL,
sample_info = NULL
)
model |
A model generated with make_xgb_models and has appended predictions with add_predictions. |
name |
The name of the perturbation whose prediction we want to plot. |
model_data |
The training dataset used to generate the model. |
n_features |
The number of top contributors to show their individual contribution. All other predictors will have their contribution combined. |
n_columns |
Number of columns to plot in a grid when plotting more than one sample. |
sample_names |
The names of the samples we want to highlight. |
sample_colors |
If highlighting samples (with sample_names), this is a vector of colors to use. |
plot_shap_scatter(my_models, model_dataset, "ko_ctnnb1", "my_sample", "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.