View source: R/070_Hyperparameters.R
| setup_CART | R Documentation |
Setup hyperparameters for CART training.
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
)
cp |
(Tunable) Numeric [0, Inf): Complexity parameter. |
maxdepth |
(Tunable) Integer [1, 30]: Maximum depth of tree. |
minsplit |
(Tunable) Integer [1, Inf): Minimum number of observations in a node to split. |
minbucket |
(Tunable) Integer [1, Inf): Minimum number of observations in a terminal node. |
prune_cp |
(Tunable) Optional Numeric [0, Inf): Complexity for cost-complexity pruning after tree is built. NULL prunes nothing after the tree is built. |
method |
Character {"auto", "anova", "class", "poisson", "exp"}: Splitting method. |
model |
Logical: If TRUE, keep a copy of the model frame. |
maxcompete |
Integer [0, Inf): Maximum number of competitive splits. |
maxsurrogate |
Integer [0, Inf): Maximum number of surrogate splits. |
usesurrogate |
Integer [0, 2]: Number of surrogate splits to use. |
surrogatestyle |
Integer [0, 1]: Type of surrogate splits. |
xval |
Integer [0, Inf): Number of cross-validation folds. |
cost |
Optional Numeric (0, Inf) vector: One for each feature. NULL uses 1 for every feature. |
ifw |
(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification. |
Get more information from rpart::rpart and rpart::rpart.control.
CARTHyperparameters object.
EDG
cart_hyperparams <- setup_CART(cp = 0.01, maxdepth = 10L, ifw = TRUE)
cart_hyperparams
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.