rxDTree: How to return the computed class probabilites

You need to pass the output from rxDTree() to rxPredict()(using 'type' = 'prob') to get the class probabilities for each observation in your dataset.

Here is a quick example using the 'iris' dataset:

# 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, ], cp = 0.01) iris.dtreerxPredict(iris.dtree, iris[-iris.sub, ], type = "prob")
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.

Article ID: 3104221 - Last Review: 10/29/2015 06:37:00 - Revision: 1.0

Revolution Analytics

  • KB3104221