How to extract rules from rxDTree object

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))
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.
Vlastnosti

ID článku: 3103829 - Poslední kontrola: 11/01/2015 14:57:00 - Revize: 1.0

Revolution Analytics

  • KB3103829
Váš názor