Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to extract rules from rxDTree object


View products that this article applies to.

There is no direct function for printing the rules in an rxDTree object but rules can be extracted by first converting the rxDTree object to an equivalent rpart object and calling asRules() from the rattle package.

Example:
library(rattle)
set.seed(1234) 
# classification 
iris.sub <- c(sample(1:50, 25), sample(51:100, 25), sample(101:150, 25)) 
iris.dtree <- rxDTree(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width,  data = iris[iris.sub, ]) 
iris.dtree 
asRules(as.rpart(iris.dtree))

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 3103829
Revision : 1
Created on : 1/7/2017
Published on : 11/1/2015
Exists online : False
Views : 61