treesize.icrf {icrf} | R Documentation |
Size of trees in an icrf
ensemble
Description
'Size of trees (number of nodes)' in the returned forest of 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.)
Usage
treesize(x, ...)
## S3 method for class 'icrf'
treesize(x, terminal = TRUE, ...)
Arguments
x |
an object of class |
... |
'not used.' |
terminal |
'count terminal nodes only ( |
Value
'A vector containing number of nodes for the trees' in the icrf object.
Note
The icrf
'object must contain the forest component; i.e.,
created with' icrf(..., keep.forest=TRUE)
.
Author(s)
Hunyong Cho, Nicholas P. Jewell, and Michael R. Kosorok.
References
Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"
Examples
# 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)
treesize(rats.icrf)