From a4bd8fdbb7038897f1a07bdc005223bc576a406a Mon Sep 17 00:00:00 2001 From: prise6 Date: Sat, 25 Jul 2015 02:10:28 +0200 Subject: [PATCH] Writting wrapper of RefClass --- DESCRIPTION | 4 +- NAMESPACE | 4 ++ R/{VirtualTwins.R => aVirtualTwins.R} | 4 +- R/forest.fold.R | 4 ++ R/forest.wrapper.R | 68 +++++++++++++++++++++++ R/object.R | 2 +- R/object.wrapper.R | 6 +- R/tools.R | 28 +++++++++- R/tree.wrapper.R | 43 ++++++++++++++ README.md | 25 +++++++++ data-raw/sepsis.R | 2 +- inst/doc/full-example.R | 7 ++- inst/doc/full-example.Rmd | 9 +-- inst/doc/full-example.html | 22 +++----- man/VT.object.Rd | 2 +- man/{VirtualTwins.Rd => aVirtualTwins.Rd} | 16 +++--- man/vt.forest.Rd | 29 ++++++++++ man/vt.subgroups.Rd | 27 +++++++++ man/vt.tree.Rd | 28 ++++++++++ vignettes/full-example.Rmd | 5 +- 20 files changed, 297 insertions(+), 38 deletions(-) rename R/{VirtualTwins.R => aVirtualTwins.R} (93%) create mode 100644 R/forest.wrapper.R create mode 100644 R/tree.wrapper.R rename man/{VirtualTwins.Rd => aVirtualTwins.Rd} (59%) create mode 100644 man/vt.forest.Rd create mode 100644 man/vt.subgroups.Rd create mode 100644 man/vt.tree.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 5901bb8..4892455 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,7 +19,7 @@ Depends: R (>= 3.2.0), methods Collate: - 'VirtualTwins.R' + 'aVirtualTwins.R' 'data.R' 'object.R' 'difft.R' @@ -29,6 +29,7 @@ Collate: 'forest.double.R' 'forest.fold.R' 'forest.one.R' + 'forest.wrapper.R' 'formatRCTDataset.R' 'incidences.R' 'object.wrapper.R' @@ -36,4 +37,5 @@ Collate: 'tree.R' 'tree.class.R' 'tree.reg.R' + 'tree.wrapper.R' VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 14279bb..e8bc672 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,11 +2,15 @@ export(VT.difft) export(VT.forest.double) +export(VT.forest.fold) export(VT.forest.one) export(VT.object) export(VT.tree.class) export(VT.tree.reg) export(formatRCTDataset) export(vt.data) +export(vt.forest) +export(vt.subgroups) +export(vt.tree) import(methods) importClassesFrom(party,RandomForest) diff --git a/R/VirtualTwins.R b/R/aVirtualTwins.R similarity index 93% rename from R/VirtualTwins.R rename to R/aVirtualTwins.R index 68ea37f..a972ab6 100644 --- a/R/VirtualTwins.R +++ b/R/aVirtualTwins.R @@ -18,7 +18,7 @@ #' } #' #' @docType package -#' @name VirtualTwins -#' @aliases VirtualTwins-package +#' @name aVirtualTwins +#' @aliases aVirtualTwins-package #' NULL \ No newline at end of file diff --git a/R/forest.fold.R b/R/forest.fold.R index da3599f..628de32 100644 --- a/R/forest.fold.R +++ b/R/forest.fold.R @@ -25,6 +25,10 @@ #' \code{\link{VT.forest.one}}, \code{\link{VT.forest.double}} #' #' @import methods +#' +#' @export VT.forest.fold +#' + VT.forest.fold <- setRefClass( Class = "VT.forest.fold", diff --git a/R/forest.wrapper.R b/R/forest.wrapper.R new file mode 100644 index 0000000..82bc272 --- /dev/null +++ b/R/forest.wrapper.R @@ -0,0 +1,68 @@ + +#' +#' Create forest to compute difft +#' +#' \code{vt.forest} is a wrapper of \code{\link{VT.forest.one}}, +#' \code{\link{VT.forest.double}} and \code{\link{VT.forest.fold}}. +#' +#' @param forest.type character one / double / fold +#' @param vt.data \code{\link{VT.data}} or return of \code{vt.data()} function +#' @param interactions logical. If running VirtualTwins with treatment's +#' interactions, set to TRUE (default value) +#' @param method character absolute / relative / logit +#' @param ... parameters of \code{\link{VT.difft}} or \code{\link{VT.forest}} +#' +#' @return \code{VT.difft} +#' +#' @include forest.R difft.R +#' +#' @name vt.forest +#' +#' @export vt.forest + +vt.forest <- function(forest.type = "one", vt.data, interactions = T, method = "absolute", ...){ + if(!inherits(vt.data, "VT.object")) + stop("vt.data must be VT.object class") + + params <- list(...) + if (forest.type == "one"){ + if(! "rf" %in% names(params) ){ + rf <- randomForest(x = vt.data$getX(interactions = interactions, trt = NULL), + y = vt.data$getY(), + ...) + } else{ + rf <- params["rf"] + } + + vt.difft <- VT.forest.one(vt.object = vt.data, model = rf, interactions = interactions, method = method) + } else if (forest.type == "double"){ + if(! "model_trt1" %in% names(params) ){ + rf_trt1 <- randomForest(x = vt.data$getX(trt = 1, interactions = interactions), + y = vt.data$getY(1), + ...) + } else + rf_trt1 <- params["model_trt1"] + + if(! "model_trt0" %in% names(params) ){ + rf_trt0 <- randomForest(x = vt.data$getX(trt = 1, interactions = interactions), + y = vt.data$getY(1), + ...) + } else + rf_trt0 <- params["rf_trt0"] + + vt.difft <- VT.forest.double(vt.object = vt.data, model_trt1 = rf_trt1, model_trt0 = rf_trt0, method = method, ...) + } else if (forest.type == "fold"){ + fold <- ifelse(! "fold" %in% names(params) , 5, params["fold"]) + fold <- ifelse(! "ratio" %in% names(params) , 1, params["ratio"]) + vt.difft <- aVirtualTwins:::VT.forest.fold(vt.object = vt.data, fold = fold, ratio = ratio, + interactions = interactions, method = method) + + } else + stop("forest.type must be one, double or fold") + if(forest.type %in% c("one", "double")) + vt.difft$run() + else + vt.difft$run(...) + return(vt.difft) +} + diff --git a/R/object.R b/R/object.R index 791f058..adee6c0 100644 --- a/R/object.R +++ b/R/object.R @@ -1,6 +1,6 @@ # VT.OBJECT --------------------------------------------------------------- -#' VirtualTwins.object +#' VT.object #' #' A Reference Class to deal with RCT dataset #' diff --git a/R/object.wrapper.R b/R/object.wrapper.R index 1acc6af..07987c5 100644 --- a/R/object.wrapper.R +++ b/R/object.wrapper.R @@ -13,7 +13,11 @@ #' #' @return \code{VT.object} #' -#' @export +#' @include object.R +#' +#' @name vt.data +#' +#' @export vt.data vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE, ...){ data <- formatRCTDataset(dataset, outcome.field, treatment.field, interactions = TRUE) diff --git a/R/tools.R b/R/tools.R index 76c3453..e6c88c1 100644 --- a/R/tools.R +++ b/R/tools.R @@ -1,3 +1,30 @@ + +#' Visualize subgroups +#' +#' @param vt.trees \code{\link{VT.tree}} object (can be a list) +#' @param only.leaf logical select only leaf of trees +#' @param only.fav logical select only favorable subgroup (meaning with favorable label of the tree) +#' @param tables logical show tables of incidence +#' @param verbose print tables during computation +#' +#' @return data.frame of rules +#' +#' @export vt.subgroups +#' +#' @name vt.subgroups +#' + +vt.subgroups <- function(vt.trees, only.leaf = T, only.fav = T, tables = F, verbose = F){ + + if(is.list(vt.trees)){ + subgroups <- lapply(vt.trees, function(x)x$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose)) + unique(do.call(rbind, subgroups)) + } + else{ + subgroups <- vt.tree$getRules(only.leaf = only.leaf, only.fav = only.fav, tables = tables, verbose = verbose) + } +} + vt.getQAOriginal <- function(response, trt, ahat){ if(is.factor(response)) response = as.numeric(response) - 1 @@ -43,4 +70,3 @@ vt.rr.snd <- function(vt.difft, selected){ - diff --git a/R/tree.wrapper.R b/R/tree.wrapper.R new file mode 100644 index 0000000..0d9a673 --- /dev/null +++ b/R/tree.wrapper.R @@ -0,0 +1,43 @@ + +#' Trees to find Subgroups +#' +#' A wrapper of class VT.tree.xxx +#' +#' +#' See \code{\link{VT.tree}} +#' +#' @param tree.type character "class" for classification tree, "reg" for regression tree +#' @param vt.difft \code{\link{VT.difft}} object +#' @param sens character c(">","<"). See details. +#' @param threshold numeric It can be a unique value or a vector +#' +#' @return \code{VT.tree} or a list of \code{VT.tree} depending on threshold dimension +#' +#' @include tree.R +#' +#' @name vt.tree +#' +#' @export vt.tree + +vt.tree <- function(tree.type = "class", vt.difft, sens = ">", threshold = seq(.5, .8, .1), screening = NULL, ...){ + if(!inherits(vt.difft, "VT.difft")) + stop("vt.difft parameter must be aVirtualTwins::VT.difft class") + if(is.numeric(threshold)){ + if(length(threshold)>1){ + res.name <- paste0("tree", 1:length(threshold)) + res.list <- lapply(X = threshold, FUN = vt.tree, tree.type = tree.type, vt.difft = vt.difft, sens = sens, screening = screening, ...) + names(res.list) <- res.name + return(res.list) + }else{ + if(tree.type == "class") + tree <- aVirtualTwins:::VT.tree.class(vt.difft = vt.difft, sens = sens, threshold = threshold, screening = screening) + else + tree <- aVirtualTwins:::VT.tree.reg(vt.difft = vt.difft, sens = sens, threshold = threshold, screening = screening) + + tree$run(...) + + return(tree) + } + }else + stop("threshold must be numeric") +} diff --git a/README.md b/README.md index 09a05b4..878319a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,31 @@ VirtualTwins is a method of subgroup identification from randomized clinical tri As an intern in a french pharmaceutical group, i worked on this method and develop a package based on Jared Foster and al method. +## (Very) Quick Preview + +```r +# Load data +data(sepsis) +# Format data +vt.obj <- vt.data(sepsis, "survival", "THERAPY", T) +# First step : create random forest model +vt.for <- vt.forest("one", vt.obj, T, ntree = 500) +# Second step : find rules in data +vt.trees <- vt.tree("class", vt.for, threshold = quantile(vt.for$difft, seq(.5,.8,.1)), maxdepth = 2) +# Print results +(vt.subgroups <- lapply(vt.trees, function(x)x$getRules(only.fav = T, verbose = F))) +``` +| |Subgroup |Subgroup size |Treatement event rate |Control event rate |Treatment sample size |Control sample size | RR (resub)| RR (snd)| +|:-------|:---------------------------|:-------------|:---------------------|:------------------|:---------------------|:-------------------|----------:|--------:| +|tree1 |PRAPACHE>=26.5 |157 |0.752 |0.327 |105 |52 | 2.300| 1.873| +|tree2 |PRAPACHE>=26.5 |157 |0.752 |0.327 |105 |52 | 2.300| 1.873| +|tree3.3 |PRAPACHE>=26.5 |157 |0.752 |0.327 |105 |52 | 2.300| 1.873| +|tree3.7 |PRAPACHE>=26.5 & AGE>=54.88 |111 |0.887 |0.325 |71 |40 | 2.729| 2.026| +|tree4.3 |PRAPACHE>=26.5 |157 |0.752 |0.327 |105 |52 | 2.300| 1.873| +|tree4.7 |PRAPACHE>=26.5 & AGE>=54.88 |111 |0.887 |0.325 |71 |40 | 2.729| 2.026| + + + ## Infos Currently this package works for RCT with two treatments groups and binary outcome. diff --git a/data-raw/sepsis.R b/data-raw/sepsis.R index 8426590..d051ff1 100644 --- a/data-raw/sepsis.R +++ b/data-raw/sepsis.R @@ -2,7 +2,7 @@ # Create sepsis data ------------------------------------------------------ # Load some libraries -library(VirtualTwins) +library(aVirtualTwins) library(randomForest) # Sepsis is a csv file available in SIDES example to this address: diff --git a/inst/doc/full-example.R b/inst/doc/full-example.R index 332df9a..f90f0f7 100644 --- a/inst/doc/full-example.R +++ b/inst/doc/full-example.R @@ -6,7 +6,7 @@ ## ------------------------------------------------------------------------ # load library VT -library(VirtualTwins) +library(aVirtualTwins) # load data sepsis data(sepsis) # initialize VT.object @@ -88,9 +88,10 @@ vt.doublef.rf <- VT.forest.double(vt.o, model.rf.trt1, model.rf.trt0) # Then, use run() to compute probabilities vt.doublef.rf$run() -## ---- cache=TRUE--------------------------------------------------------- +## ---- cache=F------------------------------------------------------------ + # initialize k-fold RF -model.fold <- VirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T) +model.fold <- aVirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T) # grow RF with randomForest package options # set do.trace option to see the 5 folds model.fold$run(ntree = 500, do.trace = 500) diff --git a/inst/doc/full-example.Rmd b/inst/doc/full-example.Rmd index d1b6028..295bdc3 100644 --- a/inst/doc/full-example.Rmd +++ b/inst/doc/full-example.Rmd @@ -129,7 +129,7 @@ vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE __Example with Sepsis__ ```{r} # load library VT -library(VirtualTwins) +library(aVirtualTwins) # load data sepsis data(sepsis) # initialize VT.object @@ -278,7 +278,7 @@ This idea is taken from *method 3* of Jared Foster paper : > A modification of [previous methods] is to obtain $\hat{P_{1i}}$ and $\hat{P_{0i}}$ via cross-validation. In this méthod the specific data for subject $i$ is not used to obtain $\hat{P_{1i}}$ and $\hat{P_{0i}}$. Using k-fold cross-validation, we apply random forest regression approach to $\frac{k-1}{k}$ of the data and use the resulting predictor to obtain estimates of $P_{1i}$ and $P_{0i}$ for the remaining $\frac{1}{k}$ of the observations. This is repeated $k$ times. -To use this approach, type `VirtualTwins:::VT.forest.fold()`. This class takes in argument : +To use this approach, type `aVirtualTwins:::VT.forest.fold()`. This class takes in argument : * `vt.object` : return of `vt.data()` function * `fold` : number of fold (e.g. $5$) @@ -287,9 +287,10 @@ To use this approach, type `VirtualTwins:::VT.forest.fold()`. This class takes i __NOTE:__ This function use only `randomForest` package. -```{r, cache=TRUE} +```{r, cache=F} + # initialize k-fold RF -model.fold <- VirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T) +model.fold <- aVirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T) # grow RF with randomForest package options # set do.trace option to see the 5 folds model.fold$run(ntree = 500, do.trace = 500) diff --git a/inst/doc/full-example.html b/inst/doc/full-example.html index 5240281..3087183 100644 --- a/inst/doc/full-example.html +++ b/inst/doc/full-example.html @@ -10,7 +10,7 @@ - + Virtual Twins Examples @@ -54,7 +54,7 @@ code > span.er { color: #ff0000; font-weight: bold; } @@ -150,7 +150,7 @@ code > span.er { color: #ff0000; font-weight: bold; } }

Example with Sepsis

# load library VT
-library(VirtualTwins)
+library(aVirtualTwins)
 # load data sepsis
 data(sepsis)
 # initialize VT.object
@@ -189,10 +189,8 @@ vt.o.tmp <- vt.data(sepsis.tm
 
 

with randomForest

# use randomForest::randomForest()
-library(randomForest, verbose = F)
-
## randomForest 4.6-10
-## Type rfNews() to see new features/changes/bug fixes.
-
# Reproducibility
+library(randomForest, verbose = F)
+# Reproducibility
 set.seed(123)
 # Fit rf model 
 # default params
@@ -230,10 +228,8 @@ vt.o.tr$data$survival <- as.factorformatRCTDataset(vt.o.tr$data, "survival", "THERAPY")
## "y" will be the favorable outcome
# use caret::train()
-library(caret, verbose = F)
-
## Loading required package: lattice
-## Loading required package: ggplot2
-
# Reproducibility
+library(caret, verbose = F)
+# Reproducibility
 set.seed(123)
 # fit train model
 fitControl <- trainControl(classProbs = T, method = "none")
@@ -276,7 +272,7 @@ vt.doublef.rf$run()

A modification of [previous methods] is to obtain \(\hat{P_{1i}}\) and \(\hat{P_{0i}}\) via cross-validation. In this méthod the specific data for subject \(i\) is not used to obtain \(\hat{P_{1i}}\) and \(\hat{P_{0i}}\). Using k-fold cross-validation, we apply random forest regression approach to \(\frac{k-1}{k}\) of the data and use the resulting predictor to obtain estimates of \(P_{1i}\) and \(P_{0i}\) for the remaining \(\frac{1}{k}\) of the observations. This is repeated \(k\) times.

-

To use this approach, type VirtualTwins:::VT.forest.fold(). This class takes in argument :

+

To use this approach, type aVirtualTwins:::VT.forest.fold(). This class takes in argument :

NOTE: This function use only randomForest package.

# initialize k-fold RF
-model.fold <- VirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T)
+model.fold <- aVirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T)
 # grow RF with randomForest package options
 # set do.trace option to see the 5 folds
 model.fold$run(ntree = 500, do.trace = 500)
diff --git a/man/VT.object.Rd b/man/VT.object.Rd index 8ad06d6..86a6dc2 100644 --- a/man/VT.object.Rd +++ b/man/VT.object.Rd @@ -3,7 +3,7 @@ \docType{class} \name{VT.object} \alias{VT.object} -\title{VirtualTwins.object} +\title{VT.object} \description{ A Reference Class to deal with RCT dataset } diff --git a/man/VirtualTwins.Rd b/man/aVirtualTwins.Rd similarity index 59% rename from man/VirtualTwins.Rd rename to man/aVirtualTwins.Rd index c00d0a8..dff4c00 100644 --- a/man/VirtualTwins.Rd +++ b/man/aVirtualTwins.Rd @@ -1,21 +1,21 @@ % Generated by roxygen2 (4.1.1): do not edit by hand -% Please edit documentation in R/VirtualTwins.R +% Please edit documentation in R/aVirtualTwins.R \docType{package} -\name{VirtualTwins} -\alias{VirtualTwins} -\alias{VirtualTwins-package} -\title{VirtualTwins : An adapation of VirtualTwins method created by Jared Foster.} +\name{aVirtualTwins} +\alias{aVirtualTwins} +\alias{aVirtualTwins-package} +\title{aVirtualTwins : An adapation of VirtualTwins method created by Jared Foster.} \description{ -VirtualTwins is written mainly with reference classes. Briefly, there is three kinds of class : +aVirtualTwins is written mainly with reference classes. Briefly, there is three kinds of class : \itemize{ - \item \code{\link{VT.object}} class to represent RCT dataset used by VirtualTwins. To format correctly RCT dataset, use \code{\link{formatRCTDataset}}. + \item \code{\link{VT.object}} class to represent RCT dataset used by aVirtualTwins. To format correctly RCT dataset, use \code{\link{formatRCTDataset}}. \item \code{\link{VT.difft}} class to compute difference between twins. Family \code{\link{VT.forest}} extends it to compute twins by random forest. \item \code{\link{VT.tree}} class to find subgroups from \code{difft} by CART trees. \code{\link{VT.tree.class}} and \code{\link{VT.tree.reg}} extend it. } } \section{TODO LIST}{ -\emph{last update : 11.06.2015} +\emph{last update : 24.07.2015} \itemize{ \item More detailed documentation and vignettes \item Write wrappers for classes diff --git a/man/vt.forest.Rd b/man/vt.forest.Rd new file mode 100644 index 0000000..b9df0ba --- /dev/null +++ b/man/vt.forest.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/forest.wrapper.R +\name{vt.forest} +\alias{vt.forest} +\title{Create forest to compute difft} +\usage{ +vt.forest(forest.type = "one", vt.data, interactions = T, + method = "absolute", ...) +} +\arguments{ +\item{forest.type}{character one / double / fold} + +\item{vt.data}{\code{\link{VT.data}} or return of \code{vt.data()} function} + +\item{interactions}{logical. If running VirtualTwins with treatment's +interactions, set to TRUE (default value)} + +\item{method}{character absolute / relative / logit} + +\item{...}{parameters of \code{\link{VT.difft}} or \code{\link{VT.forest}}} +} +\value{ +\code{VT.difft} +} +\description{ +\code{vt.forest} is a wrapper of \code{\link{VT.forest.one}}, +\code{\link{VT.forest.double}} and \code{\link{VT.forest.fold}}. +} + diff --git a/man/vt.subgroups.Rd b/man/vt.subgroups.Rd new file mode 100644 index 0000000..3bc73ab --- /dev/null +++ b/man/vt.subgroups.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/tools.R +\name{vt.subgroups} +\alias{vt.subgroups} +\title{Visualize subgroups} +\usage{ +vt.subgroups(vt.trees, only.leaf = T, only.fav = T, tables = F, + verbose = F) +} +\arguments{ +\item{vt.trees}{\code{\link{VT.tree}} object (can be a list)} + +\item{only.leaf}{logical select only leaf of trees} + +\item{only.fav}{logical select only favorable subgroup (meaning with favorable label of the tree)} + +\item{tables}{logical show tables of incidence} + +\item{verbose}{print tables during computation} +} +\value{ +data.frame of rules +} +\description{ +Visualize subgroups +} + diff --git a/man/vt.tree.Rd b/man/vt.tree.Rd new file mode 100644 index 0000000..4f38fe4 --- /dev/null +++ b/man/vt.tree.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/tree.wrapper.R +\name{vt.tree} +\alias{vt.tree} +\title{Trees to find Subgroups} +\usage{ +vt.tree(tree.type = "class", vt.difft, sens = ">", threshold = seq(0.5, + 0.8, 0.1), screening = NULL, ...) +} +\arguments{ +\item{tree.type}{character "class" for classification tree, "reg" for regression tree} + +\item{vt.difft}{\code{\link{VT.difft}} object} + +\item{sens}{character c(">","<"). See details.} + +\item{threshold}{numeric It can be a unique value or a vector} +} +\value{ +\code{VT.tree} or a list of \code{VT.tree} depending on threshold dimension +} +\description{ +A wrapper of class VT.tree.xxx +} +\details{ +See \code{\link{VT.tree}} +} + diff --git a/vignettes/full-example.Rmd b/vignettes/full-example.Rmd index 86e2773..295bdc3 100644 --- a/vignettes/full-example.Rmd +++ b/vignettes/full-example.Rmd @@ -129,7 +129,7 @@ vt.data <- function(dataset, outcome.field, treatment.field, interactions = TRUE __Example with Sepsis__ ```{r} # load library VT -library(VirtualTwins) +library(aVirtualTwins) # load data sepsis data(sepsis) # initialize VT.object @@ -287,7 +287,8 @@ To use this approach, type `aVirtualTwins:::VT.forest.fold()`. This class takes __NOTE:__ This function use only `randomForest` package. -```{r, cache=TRUE} +```{r, cache=F} + # initialize k-fold RF model.fold <- aVirtualTwins:::VT.forest.fold(vt.o, fold = 5, ratio = 1, interactions = T) # grow RF with randomForest package options