ctree_wrapper {TSDT} | R Documentation |
ctree_wrapper
Description
A wrapper function to ctree
Usage
ctree_wrapper(response, covariates = NULL, tree_builder_parameters = list())
Arguments
response |
Response variable to use in ctree model. |
covariates |
Covariates to use in ctree model. |
tree_builder_parameters |
A named list of parameters to pass to ctree. |
Value
An object of class CTree
See Also
Examples
requireNamespace( "party", quietly = TRUE )
## From party::ctree() examples:
set.seed(290875)
airq <- subset(airquality, !is.na(Ozone))
## Provide response and covariates to fit ctree
ex1 <- ctree_wrapper( response = airq$Ozone,
covariates = subset( airq, select = -Ozone ) )
## Pass list of control parameters. Note that ctree takes a parameter called
## 'controls' (with an 's'), rather than 'control' as in rpart.
ex2 <- ctree_wrapper( response = airq$Ozone,
covariates = subset( airq, select = -Ozone ),
tree_builder_parameters = list( controls =
party::ctree_control( maxdepth = 2 ) ) )
[Package TSDT version 1.0.7 Index]