Last chance! 50% off unlimited learning
Sale ends in
vt.forest
is a wrapper of VT.forest.one
,
VT.forest.double
and VT.forest.fold
. With
parameter forest.type, any of these class can be used with its own parameter.
vt.forest(forest.type = "one", vt.data, interactions = T,
method = "absolute", model = NULL, model_trt1 = NULL,
model_trt0 = NULL, ratio = 1, fold = 10, ...)
must be a character. "one" to use VT.forest.one class. "double" to use VT.forest.double. "fold" to use VT.forest.fold.
VT.object
. Can be return of vt.data()
function
logical. If running VirtualTwins with treatment's interactions, set to TRUE (default value)
character c("absolute", "relative", "logit"). See
VT.difft
.
allows to give a model you build outside this function. Can be randomForest, train or cforest. Is only used with forest.type = "one". If NULL, a randomForest model is grown inside the function. NULL is default.
see model_trt0 explanation and
VT.forest.double
details.
works the same as model parameter. Is only used with
forest.type = "double". If NULL, a randomForest model is grown inside the
function. NULL is default. See VT.forest.double
for details.
numeric value that allow sampsize to be a bit controlled.
Default to 1. See VT.forest.fold
.
number of fold you want to construct forest with k-fold method.
Is only used with forest.type = "fold". Default to 5. See
VT.forest.fold
randomForest() function parameters. Can be used for any forest.type.
VT.difft
# NOT RUN {
data(sepsis)
vt.o <- vt.data(sepsis, "survival", "THERAPY", T)
# inside model :
vt.f <- vt.forest("one", vt.o)
# ...
# your model :
# library(randomForest)
# rf <- randomForest(y = vt.o$getY(),
# x = vt.o$getX(int = T),
# mtry = 3,
# nodesize = 15)
# vt.f <- vt.forest("one", vt.o, model = rf)
# ...
# Can also use ... parameters
vt.f <- vt.forest("one", vt.o, mtry = 3, nodesize = 15)
# ...
# }
Run the code above in your browser using DataLab