r descr_models("mars", "earth")

Tuning Parameters

defaults <- 
  tibble::tibble(parsnip = c("num_terms", "prod_degree", "prune_method"),
                 default = c("see below", "1L", "'backward'"))

param <-
  mars() %>% 
  set_engine("earth") %>% 
  make_parameter_list(defaults)

This model has r nrow(param) tuning parameters:

param$item

Parsnip changes the default range for num_terms to c(50, 500).

Translation from parsnip to the original package (regression)

mars(num_terms = integer(1), prod_degree = integer(1), prune_method = character(1)) %>% 
  set_engine("earth") %>% 
  set_mode("regression") %>% 
  translate()

Translation from parsnip to the original package (classification)

mars(num_terms = integer(1), prod_degree = integer(1), prune_method = character(1)) %>% 
  set_engine("earth") %>% 
  set_mode("classification") %>% 
  translate()

An alternate method for using MARs for categorical outcomes can be found in [discrim_flexible()].

Preprocessing requirements


Case weights


Note that the earth package documentation has: "In the current implementation, building models with weights can be slow."

Saving fitted model objects


Examples

The "Fitting and Predicting with parsnip" article contains examples for mars() with the "earth" engine.

References



tidymodels/parsnip documentation built on Feb. 19, 2025, 2:10 a.m.