Skip to content
Back to formatted view

Raw Message

Message-ID: <7118bec067ff4209802b572650539a1b.squirrel@webmail.uic.edu>
Date: 2017-01-13T21:57:51Z
From: Sparks, John
Subject: cforest Single Tree Output for Categorical Variable

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.