install.packages("xspliner")
devtools::install_github("ModelOriented/xspliner")
library(xspliner)
library(randomForest)
library(pdp)
data(boston)
set.seed(123)
# fitting random forest model
model_rf <- randomForest(cmedv ~ lstat + ptratio + age, data = boston)
# building GLM (with standard black box response - Partial Dependence)
xspliner <- xspline(model_rf)
# see standard glm results
summary(xspliner)
# see ptratio variable transformation
plot(xspliner, "ptratio")
# compare xspliner and base model responses
plot(xspliner, model = model_rf, data = boston)
For more info check project vignettes or examples.
See github issues