[R] cforest Single Tree Output for Categorical Variable

Sparks, John James jspark4 at uic.edu
Fri Jan 13 22:57:51 CET 2017


Hello R Helpers,

I am building a random forest using the cforest method in the party
package.  I then want to have a look at the characteristics of a few of
the trees.  I get the output for one of the trees by executing

pt <- party:::prettytree(cforest at ensemble[[3]],
names(cforest at data@get("input")))
pt

The first splitting variable is a categorical variable (here named cat,
which contains value 0 through 9 and is a factor), but the output does not
specify which values went into which part of the tree:

1) cat == {}; criterion = 1, statistic = 32.792

Can anyone help me to get the detail on this splitting variable to appear
in the output?

I regret that I cannot send a reproducible example because the data is
proprietary.  I will try to work up an example with a public data set that
has the same problem.

Any help would be much appreciated.

Best wishes,
--John J. Sparks, Ph.D.



More information about the R-help mailing list