split.shapviz | R Documentation |
Splits "shapviz" object along a vector f
into an object of class "mshapviz".
## S3 method for class 'shapviz'
split(x, f, ...)
x |
Object of class "shapviz". |
f |
Vector used to split feature values and SHAP (interaction) values. Empty factor levels are dropped. |
... |
Arguments passed to |
A "mshapviz" object.
shapviz()
, rbind.shapviz()
## Not run:
dtrain <- xgboost::xgb.DMatrix(data.matrix(iris[, -1]), label = iris[, 1])
fit <- xgboost::xgb.train(data = dtrain, nrounds = 10, nthread = 1)
sv <- shapviz(fit, X_pred = dtrain, X = iris)
mx <- split(sv, f = iris$Species)
sv_dependence(mx, "Petal.Length")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.