I would like to create a table to summarise the splitting rules of a conditional inference tree (ctree) so that each predictor is in a separate column and each row is a terminal node with corresponding values from each of the predictors. For example:
IrisTree <- ctree(Species ~ ., data = iris)
which results in this tree:
and store the results in a way such as below:
Also, I would like to embed in a last column each of the plots resulting at terminal nodes, but I am struggling to find a way to store plots separately. Is it possible?
Split rules
The split summary can be built on the (still unexported) function
.list.rules.party()
:For further processing of split summaries, see also the following answers:
Plotting subtrees
The individual plots can be easily obtained by subsetting the tree suitably. In general if
tree
is aparty
object, thentree[i]
is theparty
object rooted in Nodei
. These can still be plotted as before.Thus, when selecting and plotting only a terminal node, this gives you the panel from that terminal node: