examples/simple_graphics.R

library(randomForest)
library(pdp)
data(boston)
set.seed(101)

# build random forest model:
boston.rf <- randomForest(cmedv ~ rm + lstat + nox, data = boston)

# build xspliner model with specified response method and approximation options
model_pdp <- xspline(
  cmedv ~ rm + lstat +
    xs(nox, effect = list(type = "pdp", grid.resolution = 100), transition = list(k = 10, bs = "cr")),
  model = boston.rf
)

plot(model_pdp, "nox", data = boston, plot_data = TRUE)
plot(model_pdp, "nox")
ModelOriented/xspliner documentation built on Oct. 5, 2019, 3:42 p.m.