bagEarth2sas: Export a bagged MARS model to SAS

Description Usage Arguments Details Examples

Description

Generate SAS DATA step code to predict the values of a bagged Multivariate Adaptive Regression Splines (MARS) model from the caret package.

Usage

1
bagEarth2sas(fit, name = "prediction", drop = TRUE)

Arguments

fit

a bagged MARS model trained by bagEarth. It may be the object returned by train.

name

the name of the variable in which to store the prediction

drop

whether to drop the variables for the individual trees

Details

This function supports regression and binary classification (when earth is called with glm=list(family=binomial).

This function supports only numeric variables, so any factors must first be converted to numeric variables (as train normally does).

In the case of binary classification, the predicted values are probabilities (not log-odds).

Examples

1
2
3
4
require(caret)
trees.bagEarth <- bagEarth(Volume ~ ., data=trees, B=2)
trees.sas <- bagEarth2sas(trees.bagEarth)
cat(trees.sas, file="trees.sas")

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