79674411

Date: 2025-06-21 12:06:47
Score: 0.5
Natty:
Report link

The new {shapviz} release 0.10.0 now supports this out-of-the box:

library(shapviz)
library(ggplot2)
library(gridExtra)

set.seed(1)

X_train <- data.matrix(`colnames<-`(replicate(26, rnorm(100)), LETTERS))
dtrain <- xgboost::xgb.DMatrix(X_train, label = rnorm(100))
fit <- xgboost::xgb.train(data = dtrain, nrounds = 50)
shp <- shapviz(fit, X_pred = X_train)
mshp <- c(a = shp, b = shp, c = shp)

sv_importance(mshp, kind = "bee", show_numbers = TRUE)

gives

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: Michael M