GetCtree.Rd
This function gets the ith tree from a conditional random forest as produced by cforest
.
GetCtree(object, k = 1)
An object as returned by cforest
(or fastcforest
).
The index of the tree to get from the forest. Default is 1.
A tree of class BinaryTree
, as returned by ctree
from party
package.
Code taken from https://stackoverflow.com/questions/19924402/cforest-prints-empty-tree
data(iris)
iris2 = iris
iris2$Species = factor(iris$Species == "versicolor")
iris.cf = party::cforest(Species ~ ., data = iris2,
control = party::cforest_unbiased(mtry = 2, ntree = 50))
plot(GetCtree(iris.cf))