Builds generalized linear model with automatic data transformation. The 'xspliner' helps to build simple, interpretable models that inherits informations provided by more complicated ones. The resulting model may be treated as explanation of provided black box, that was supplied prior to the algorithm.
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)
See github issues