Setup hyperparameters for CART training.
Usage
setup_CART(
cp = 0.01,
maxdepth = 20L,
minsplit = 2L,
minbucket = 1L,
prune_cp = NULL,
method = "auto",
model = TRUE,
maxcompete = 4L,
maxsurrogate = 5L,
usesurrogate = 2L,
surrogatestyle = 0L,
xval = 0L,
cost = NULL,
ifw = FALSE
)Arguments
- cp
(Tunable) Numeric: Complexity parameter.
- maxdepth
(Tunable) Integer: Maximum depth of tree.
- minsplit
(Tunable) Integer: Minimum number of observations in a node to split.
- minbucket
(Tunable) Integer: Minimum number of observations in a terminal node.
- prune_cp
(Tunable) Numeric: Complexity for cost-complexity pruning after tree is built
- method
String: Splitting method.
- model
Logical: If TRUE, return a model.
- maxcompete
Integer: Maximum number of competitive splits.
- maxsurrogate
Integer: Maximum number of surrogate splits.
- usesurrogate
Integer: Number of surrogate splits to use.
- surrogatestyle
Integer: Type of surrogate splits.
- xval
Integer: Number of cross-validation folds.
- cost
Numeric (>=0): One for each feature.
- ifw
Logical: If TRUE, use Inverse Frequency Weighting in classification.
Details
Get more information from rpart::rpart and rpart::rpart.control.
Examples
cart_hyperparams <- setup_CART(cp = 0.01, maxdepth = 10L, ifw = TRUE)
cart_hyperparams
#> <CARTHyperparameters>
#> hyperparameters:
#> cp: <nmr> 0.01
#> maxdepth: <int> 10
#> minsplit: <int> 2
#> minbucket: <int> 1
#> prune_cp: <NUL> NULL
#> method: <chr> auto
#> model: <lgc> TRUE
#> maxcompete: <int> 4
#> maxsurrogate: <int> 5
#> usesurrogate: <int> 2
#> surrogatestyle: <int> 0
#> xval: <int> 0
#> cost: <NUL> NULL
#> ifw: <lgc> TRUE
#> tunable_hyperparameters: <chr> cp, maxdepth, minsplit, minbucket, prune_cp, ifw
#> fixed_hyperparameters: <chr> method, model, maxcompete, maxsurrogate, usesurrogate, surrogatestyle, xval, cost
#> tuned: <int> -1
#> resampled: <int> 0
#> n_workers: <int> 1
#>
#> No search values defined for tunable hyperparameters.