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.

rxDTree: How to return the computed class probabilites


View products that this article applies to.

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.dtree

rxPredict(iris.dtree, iris[-iris.sub, ], type = "prob")

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 3104221
Revision : 1
Created on : 1/7/2017
Published on : 10/29/2015
Exists online : False
Views : 59