View source: R/070_Hyperparameters.R
| setup_MARS | R Documentation |
Setup hyperparameters for Multivariate Adaptive Regression Splines training.
setup_MARS(
degree = 1L,
penalty = NULL,
nk = NULL,
nprune = NULL,
thresh = 0.001,
minspan = 0L,
endspan = 0L,
newvar_penalty = 0,
fast_k = 20L,
pmethod = "backward",
nfold = 0L,
ncross = 1L,
stratify = TRUE,
fast_beta = 1,
ifw = FALSE
)
degree |
(Tunable) Integer [1, Inf): Maximum degree of interaction. 1 builds an additive model with no interaction terms. |
penalty |
(Tunable) Optional Numeric [-1, Inf): Generalized Cross Validation penalty per knot. NULL uses 3 when |
nk |
(Tunable) Optional Integer [1, Inf): Maximum number of terms, including the intercept, created by the forward pass. NULL lets earth derive it from the number of features. |
nprune |
(Tunable) Optional Integer [1, Inf): Maximum number of terms, including the intercept, retained after pruning. NULL places no cap on the terms retained, which pruning still selects by |
thresh |
(Tunable) Numeric [0, 1): Forward pass stopping threshold: stop once adding a term changes R-squared by less than this. |
minspan |
(Tunable) Integer (-Inf, Inf): Minimum number of observations between knots. 0 derives the value internally, and a negative value instead sets the maximum number of equally spaced knots per feature. |
endspan |
(Tunable) Integer [0, Inf): Minimum number of observations before the first and after the final knot. 0 derives the value internally. |
newvar_penalty |
(Tunable) Numeric [0, Inf): Penalty for adding a feature not already in the model during the forward pass. |
fast_k |
(Tunable) Integer [0, Inf): Maximum number of parent terms considered at each step of the forward pass. 0 disables Fast MARS. |
pmethod |
Character {"backward", "none", "exhaustive", "forward", "seqrep", "cv"}: Pruning method. "cv" requires |
nfold |
Integer [0, Inf): Number of cross-validation folds used to estimate out-of-fold R-squared. 0 disables cross-validation. |
ncross |
Integer [1, Inf): Number of times the |
stratify |
Logical: If TRUE, stratify the cross-validation folds on the outcome. |
fast_beta |
Numeric [0, 1]: Fast MARS aging coefficient. |
ifw |
(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification. |
Get more information from earth::earth.
get_varimp() returns earth's three importance criteria, in this order:
importance (the GCV criterion), rss (the RSS criterion), and
subset_proportion (the fraction of pruning subsets that retain the
feature). See varimp_super in train_MARS.R for how each is derived.
MARSHyperparameters object.
EDG
mars_hyperparams <- setup_MARS(degree = 2L, nprune = 10L)
mars_hyperparams
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.