as.rpart: Conversion of a RevoScaleR rxDTree object to a rpart Object
Description
Converts objects containing decision tree results to a rpart object.
Usage
## S3 method for class `rxDTree':
as.rpart (x, ...)
Arguments
x
object of class rxDTree.
...
additional arguments (currently not used).
Details
This function converts an existing object of class rxDTree an object of
class rpart
.
The underlying structure of the output object will be a subset of that produced by an equivalent call to
rpart
. Often, this method can be used to coerce an object
for use with the pmml package. RevoScaleR model objects that contain
transforms
or a transformFunc
are not supported.
Value
an object of class rpart.
Author(s)
Microsoft Corporation Microsoft Technical Support
See Also
rxDTree, as.lm, as.kmeans, as.glm, as.xtabs.
Examples
## Not run:
# If the pmml package is installed
library(pmml)
infert.nrow <- nrow(infert)
infert.sub <- sample(infert.nrow, infert.nrow / 2)
infert.dtree <- rxDTree(case ~ age + parity + education + spontaneous + induced,
data = infert[infert.sub, ], cp = 0.01)
infert.dtree
pmml(as.rpart(infert.dtree))
## End(Not run)