split.shapviz: Splits "shapviz" Object

View source: R/methods.R

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

Value

A "mshapviz" object.

See Also

shapviz(), rbind.shapviz()

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)

shapviz documentation built on Sept. 14, 2024, 5:07 p.m.