varUsed.icrf | R Documentation |
icrf
ensemble'Find out which predictor variables are actually used in' the returned forest of
the icrf
. The returned forest depends on the returnBest
argument of the
icrf
function; It is either the last forest, when returnBest = FALSE
or
the the best forest, when returnBest = TRUE
. (Quoted statements are from
randomForest
by Liaw and Wiener unless otherwise mentioned.)
varUsed(x, ...) ## S3 method for class 'icrf' varUsed(x, by.tree = FALSE, count = TRUE, ...)
x |
'an object of class' |
... |
not used. |
by.tree |
'Should the list of variables used be broken down by trees in the forest?' |
count |
'Should the frequencies that variables appear in trees be returned?' |
'A vector containing number of nodes for the trees' in the icrf object.
'If count=TRUE
and by.tree=FALSE
, an integer vector containing
frequencies that variables are used in the forest. If by.tree=TRUE
, a matrix is returned,
breaking down the counts by tree (each column corresponding to one tree and each row to a variable).'
'If count=FALSE
and by.tree=TRUE
, a list of integer indices is returned giving the
variables used in the trees, else if by.tree=FALSE
, a vector of integer indices giving
the variables used in the entire forest.'
Hunyong Cho, Nicholas P. Jewell, and Michael R. Kosorok.
Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"
# rats data example. # Note that this is a toy example. Use a larger ntree and nfold in practice. data(rat2) set.seed(1) rats.icrf <- icrf(~ dose.lvl + weight + male + cage.no, data = rat2, data.type = "currentstatus", currentstatus.label = c("survtime", "tumor"), returnBest = TRUE, ntree=10, nfold=3) varUsed(rats.icrf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.