ctree2sas: Export a decision tree to SAS

Description Usage Arguments Details Examples

Description

Generate SAS DATA step code to predict the values of a conditional inference tree from the party package.

Usage

1
2
ctree2sas(mytree, name = "prediction", node_id = 1,
  parent_criteria = character(0))

Arguments

mytree

a decision tree model trained by ctree

name

the name of the variable in which to store the prediction

node_id

the initial node (used internally)

parent_criteria

used internally

Details

For regression, the prediction is the average for the node. For binary classification, the probability is given. For multinomial classification, the most likely level is returned.

Models may be built with inputs variables that are either numeric or unordered factors, while ordered factors and missing values are not supported.

Examples

1
2
3
4
require(party)
iris.ct <- ctree(Species ~ . , data = iris)
iris.sas <- ctree2sas(iris.ct)
cat(iris.sas, file="iris.sas")

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