# NOT RUN {
library(gbm)
data(audit)
mod <- gbm(Adjusted ~ .,
data = audit[, -c(1, 4, 6, 9, 10, 11, 12)],
n.trees = 3, interaction.depth = 4
)
mod_pmml <- pmml(mod)
# Classification example:
mod2 <- gbm(Species ~ .,
data = iris, n.trees = 2,
interaction.depth = 3, distribution = "multinomial"
)
# The PMML will include a regression model to read the gbm object outputs
# and convert to a "response" prediction type.
mod2_pmml <- pmml(mod2)
# }
Run the code above in your browser using DataLab