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
)MARSHyperparameters object.
(Tunable) Integer [1, Inf): Maximum degree of interaction. 1 builds an additive model with no interaction terms.
(Tunable) Optional Numeric [-1, Inf): Generalized Cross Validation penalty per knot. NULL uses 3 when degree is greater than 1 and 2 otherwise.
(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.
(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 pmethod.
(Tunable) Numeric [0, 1): Forward pass stopping threshold: stop once adding a term changes R-squared by less than this.
(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.
(Tunable) Integer [0, Inf): Minimum number of observations before the first and after the final knot. 0 derives the value internally.
(Tunable) Numeric [0, Inf): Penalty for adding a feature not already in the model during the forward pass.
(Tunable) Integer [0, Inf): Maximum number of parent terms considered at each step of the forward pass. 0 disables Fast MARS.
Character {"backward", "none", "exhaustive", "forward", "seqrep", "cv"}: Pruning method. "cv" requires nfold. Multiclass classification allows only "backward" and "none".
Integer [0, Inf): Number of cross-validation folds used to estimate out-of-fold R-squared. 0 disables cross-validation.
Integer [1, Inf): Number of times the nfold cross-validation is repeated.
Logical: If TRUE, stratify the cross-validation folds on the outcome.
Numeric [0, 1]: Fast MARS aging coefficient.
(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification.
EDG
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.
mars_hyperparams <- setup_MARS(degree = 2L, nprune = 10L)
mars_hyperparams
Run the code above in your browser using DataLab