details_bag_mars_earth | R Documentation |
baguette::bagger()
creates an collection of MARS models forming an
ensemble. All models in the ensemble are combined to produce a final prediction.
For this engine, there are multiple modes: classification and regression
This model has 3 tuning parameters:
prod_degree
: Degree of Interaction (type: integer, default: 1L)
prune_method
: Pruning Method (type: character, default: ‘backward’)
num_terms
: # Model Terms (type: integer, default: see below)
The default value of num_terms
depends on the number of predictor
columns. For a data frame x
, the default is
min(200, max(20, 2 * ncol(x))) + 1
(see
earth::earth()
and the reference below).
The baguette extension package is required to fit this model.
bag_mars(num_terms = integer(1), prod_degree = integer(1), prune_method = character(1)) %>% set_engine("earth") %>% set_mode("regression") %>% translate()
## Bagged MARS Model Specification (regression) ## ## Main Arguments: ## num_terms = integer(1) ## prod_degree = integer(1) ## prune_method = character(1) ## ## Computational engine: earth ## ## Model fit template: ## baguette::bagger(formula = missing_arg(), data = missing_arg(), ## weights = missing_arg(), nprune = integer(1), degree = integer(1), ## pmethod = character(1), base_model = "MARS")
The baguette extension package is required to fit this model.
library(baguette) bag_mars( num_terms = integer(1), prod_degree = integer(1), prune_method = character(1) ) %>% set_engine("earth") %>% set_mode("classification") %>% translate()
## Bagged MARS Model Specification (classification) ## ## Main Arguments: ## num_terms = integer(1) ## prod_degree = integer(1) ## prune_method = character(1) ## ## Computational engine: earth ## ## Model fit template: ## baguette::bagger(formula = missing_arg(), data = missing_arg(), ## weights = missing_arg(), nprune = integer(1), degree = integer(1), ## pmethod = character(1), base_model = "MARS")
Factor/categorical predictors need to be converted to numeric values
(e.g., dummy or indicator variables) for this engine. When using the
formula method via fit()
, parsnip will
convert factor columns to indicators.
This model can utilize case weights during model fitting. To use them,
see the documentation in case_weights and the examples
on tidymodels.org
.
The fit()
and fit_xy()
arguments have arguments called
case_weights
that expect vectors of case weights.
Note that the earth
package documentation has: “In the current
implementation, building models with weights can be slow.”
Breiman, L. 1996. “Bagging predictors”. Machine Learning. 24 (2): 123-140
Friedman, J. 1991. “Multivariate Adaptive Regression Splines.” The Annals of Statistics, vol. 19, no. 1, pp. 1-67.
Milborrow, S. “Notes on the earth package.”
Kuhn, M, and K Johnson. 2013. Applied Predictive Modeling. Springer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.