Splits "shapviz" object along a vector f into an object of class "mshapviz".

# 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 split().

Value

A "mshapviz" object.

Examples

if (FALSE) { # \dontrun{
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")
} # }