NodesInfo.RdRetrieves informations about terminal nodes of a conditional inference tree : node id, rule set, frequency, prediction or class probabilities.
NodesInfo(ct)A data frame.
Hothorn T, Hornik K, Van De Wiel MA, Zeileis A. "A lego system for conditional inference". The American Statistician. 60:257–263, 2006.
Hothorn T, Hornik K, Zeileis A. "Unbiased Recursive Partitioning: A Conditional Inference Framework". Journal of Computational and Graphical Statistics, 15(3):651-674, 2006.
ctree
data(iris)
iris2 = iris
iris2$Species = factor(iris$Species == "versicolor")
iris.ct = partykit::ctree(Species ~ ., data = iris2)
NodesInfo(iris.ct)
#> id rule freq Species.FALSE Species.TRUE
#> 1 3 Sepal.Width <= 2.9 & Petal.Width <= 1.6 39 12.82 87.18
#> 2 4 Sepal.Width <= 2.9 & Petal.Width > 1.6 18 100.00 0.00
#> 3 6 Sepal.Width > 2.9 & Sepal.Width <= 3.3 56 73.21 26.79
#> 4 7 Sepal.Width > 2.9 & Sepal.Width > 3.3 37 97.30 2.70