Rules | R Documentation |
Extract rules from an rpart object. This can be useful, if the rules must be implemented in another system. The rules contain all the criteria for the binary splits of an rpart tree from the root node down to the specified leaf.
Rules(x, node = NULL, leafonly = FALSE)
x |
the rpart object to extract the rules from |
node |
integer vector, defining the nodes whose details are required. |
leafonly |
boolean, defining if only the rules leading to end nodes ("leafs") should be returned. |
The function builds upon the original function path.rpart
, which is bulky in some situations.
a list with the rules
frame |
the frame of the rpart |
ylevels |
the y values of the node |
ds.size |
the size of the dataset |
path |
a list of character vecotrs containing the rules |
Andri Signorell <andri@signorell.net>
rpart
, path.rpart
r.rp <- FitMod(diabetes ~ ., data=d.pima, fitfn="rpart")
Rules(r.rp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.