| interpret-shap-methods | R Documentation |
These methods provide the standard print(), summary(), and plot()
interfaces for funcml_shap objects returned by interpret(method = "shap").
## S3 method for class 'funcml_shap'
plot(
x,
kind = c("auto", "waterfall", "force", "summary", "beeswarm", "importance", "bar",
"dependence", "dependence2d", "interaction"),
...
)
## S3 method for class 'funcml_shap'
print(x, ...)
## S3 method for class 'funcml_shap'
summary(object, ...)
x |
A |
kind |
Plot kind. One of |
... |
Additional arguments passed to the underlying method. For
|
object |
A |
plot() returns a ggplot2 object. print() returns the input
object invisibly. summary() returns the SHAP contribution table
invisibly.
fit_obj <- fit(mpg ~ wt + hp + disp, data = mtcars, model = "rpart",
spec = list(cp = 0.01, minsplit = 5))
shap <- interpret(
fit = fit_obj,
data = mtcars,
method = "shap",
newdata = mtcars[1, , drop = FALSE],
nsim = 1
)
print(shap)
summary(shap)
plot(shap)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.