gbm2sas: Export a Gradient Boosted Regression Model (GBM) to SAS

Description Usage Arguments Details Examples

Description

Generates SAS DATA step code to predict the values of a GBM model.

Usage

1
gbm2sas(fit, n.trees = fit$n.trees, drop = TRUE)

Arguments

fit

the model fitted by gbm

n.trees

the number of trees to export

drop

whether to drop the variables for the individual trees

Details

This function supports unordered factors, ordered factors, and missing values. No special considerations are needed for the Gaussian distribution, and for other distributions, the user is responsible for the link function in SAS.

Examples

1
2
3
4
5
require(gbm)
mtcars.gbm <- gbm(mpg ~ cyl + disp, data = mtcars, bag.fraction = 1.1,
    distribution = "gaussian")
mtcars.sas <- gbm2sas(mtcars.gbm)
cat(mtcars.sas, file='mtcars.sas')

az0/mlmeta documentation built on May 11, 2019, 4:15 p.m.