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
)CARTHyperparameters object.
(Tunable) Numeric [0, Inf): Complexity parameter.
(Tunable) Integer [1, 30]: Maximum depth of tree.
(Tunable) Integer [1, Inf): Minimum number of observations in a node to split.
(Tunable) Integer [1, Inf): Minimum number of observations in a terminal node.
(Tunable) Optional Numeric [0, Inf): Complexity for cost-complexity pruning after tree is built. NULL prunes nothing after the tree is built.
Character {"auto", "anova", "class", "poisson", "exp"}: Splitting method.
Logical: If TRUE, keep a copy of the model frame.
Integer [0, Inf): Maximum number of competitive splits.
Integer [0, Inf): Maximum number of surrogate splits.
Integer [0, 2]: Number of surrogate splits to use.
Integer [0, 1]: Type of surrogate splits.
Integer [0, Inf): Number of cross-validation folds.
Optional Numeric (0, Inf) vector: One for each feature. NULL uses 1 for every feature.
(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification.
EDG
Get more information from rpart::rpart and rpart::rpart.control.
cart_hyperparams <- setup_CART(cp = 0.01, maxdepth = 10L, ifw = TRUE)
cart_hyperparams
Run the code above in your browser using DataLab