- object
An object of class "explain".
- type
Character string specifying which type of plot to construct.
Current options are "importance" (for Shapley-based variable
importance plots), "dependence" (for Shapley-based dependence
plots), and "contribution" (for visualizing the feature contributions
to an individual prediction).
- feature
Character string specifying which feature to use when
type = "dependence". If NULL (default) the first feature will
be used to construct the plot.
- num_features
Integer specifying the number of variables to plot.
Default is NULL which will cause all variables to be displayed.
- X
A matrix-like R object (e.g., a data frame or matrix) containing
ONLY the feature columns from the training data.
- feature_values
A matrix-like R object (e.g., a data frame or matrix)
containing the feature values correposnding to the instance being explained.
Only used when type = "dependence". NOTE: Must contain the
same column structure (e.g., column names, order, etc.) as X.
- color_by
Character string specifying an optional feature column in
X to use for coloring whenever type = "dependence".
- smooth
Logical indicating whether or not to add a smoother to the
scatterplot whenever type = "dependence". Default is TRUE.
- smooth_color
The color to use for the smoother whenever
smooth = TRUE. The default is "black"; see
geom_smooth for details.
- smooth_linetype
The type of line to use for the smoother whenever
smooth = TRUE. The default is "solid"; see
geom_smooth for details.
- smooth_size
The size to use for the smoother whenever
smooth = TRUE. The default is 1; see
geom_smooth for details.
- smooth_alpha
The transparency to use for the smoother whenever
smooth = TRUE. The default is 1; see
geom_smooth for details.
- row_num
Integer specifying a single row/instance in object to
plot the explanation when type = "contribution". If NULL (the
default) the explanation for the first row/instance will be used.
- ...
Additional optional arguments to be passed on to
geom_col (if type = "importance") or
geom_point (if type = "dependence").