split.shapviz {shapviz} | R Documentation |
Splits "shapviz" Object
Description
Splits "shapviz" object along a vector f
into an object of class "mshapviz".
Usage
## S3 method for class 'shapviz'
split(x, f, ...)
Arguments
x |
Object of class "shapviz". |
f |
Vector used to split feature values and SHAP (interaction) values. Empty factor levels are dropped. |
... |
Arguments passed to |
Value
A "mshapviz" object.
See Also
Examples
## 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)
[Package shapviz version 0.9.3 Index]