| plot_shap_waterfall | R Documentation |
This method creates plots that show a waterfall of SHAP values obtained from the data stored in a familiarCollection object.
plot_shap_waterfall(
object,
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
x_label = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
limit_n_features = waiver(),
x_range = NULL,
x_n_breaks = 5L,
x_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
## S4 method for signature 'ANY'
plot_shap_waterfall(
object,
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
x_label = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
limit_n_features = waiver(),
x_range = NULL,
x_n_breaks = 5L,
x_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
## S4 method for signature 'familiarCollection'
plot_shap_waterfall(
object,
draw = FALSE,
dir_path = NULL,
split_by = NULL,
x_axis_by = NULL,
y_axis_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
ggtheme = NULL,
gradient_palette = NULL,
x_label = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
limit_n_features = waiver(),
x_range = NULL,
x_n_breaks = 5L,
x_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
object |
Additionally, some |
draw |
(optional) Draws the plot if TRUE. |
dir_path |
(optional) Path to the directory where created
plots are saved to. Output is saved in the |
split_by |
(optional) Splitting variables. This refers to column names on which datasets are split. A separate figure is created for each split. See details for available variables. |
x_axis_by |
(optional) Variable plotted along the x-axis of a plot.
The variable cannot overlap with variables provided to the |
y_axis_by |
(optional) Variable plotted along the y-axis of a plot.
The variable cannot overlap with variables provided to the |
facet_by |
(optional) Variables used to determine how and if facets of
each figure appear. In case the |
facet_wrap_cols |
(optional) Number of columns to generate when facet wrapping. If NULL, a facet grid is produced instead. |
ggtheme |
(optional) |
gradient_palette |
(optional) Divergent palette used to
colour the elements of waterfall plots. |
x_label |
(optional) Label to provide to the x-axis. If NULL, no label is shown. |
y_label |
(optional) Label to provide to the y-axis. If NULL, no label is shown. |
legend_label |
(optional) Label to provide to the legend. If NULL, the legend will not have a name. |
plot_title |
(optional) Label to provide as figure title. If NULL, no title is shown. |
plot_sub_title |
(optional) Label to provide as figure subtitle. If NULL, no subtitle is shown. |
caption |
(optional) Label to provide as figure caption. If NULL, no caption is shown. |
limit_n_features |
(optional) The number of features that should be included in the plot. Only the most important features are shown. By default, the number of features is not limited. |
x_range |
(optional) Value range for the x-axis. |
x_n_breaks |
(optional) Number of breaks to show on the x-axis of the
plot. |
x_breaks |
(optional) Break points on the x-axis of the plot. |
width |
(optional) Width of the plot. A default value is derived from the number of facets. |
height |
(optional) Height of the plot. A default value is derived from the number of features and the number of facets. |
units |
(optional) Plot size unit. Either |
export_collection |
(optional) Exports the collection if TRUE. |
... |
Arguments passed on to
|
This function creates SHAP waterfall plots, which show the individual marginal contributions of feature values to the predicted value.
Available splitting variables are: vimp_method, learner, data_set,
evaluation_time (survival outcome only) and positive_class (categorical
outcomes), sample_id. The default for is to facet by evaluation_time or
positive_class, and split by vimp_method,
learner, data_set, and sample_id. color_by is not used.
Labelling methods such as set_vimp_method_names or set_learner_names
can be applied to the familiarCollection object to update labels, and
order the output in the figure.
NULL or list of plot objects, if dir_path is NULL.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.