-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathdetails_bag_mars_earth.Rd
117 lines (99 loc) · 3.99 KB
/
details_bag_mars_earth.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bag_mars_earth.R
\name{details_bag_mars_earth}
\alias{details_bag_mars_earth}
\title{Bagged MARS via earth}
\description{
\code{\link[baguette:bagger]{baguette::bagger()}} creates an collection of MARS models forming an
ensemble. All models in the ensemble are combined to produce a final prediction.
}
\details{
For this engine, there are multiple modes: classification and regression
\subsection{Tuning Parameters}{
This model has 3 tuning parameters:
\itemize{
\item \code{prod_degree}: Degree of Interaction (type: integer, default: 1L)
\item \code{prune_method}: Pruning Method (type: character, default: ‘backward’)
\item \code{num_terms}: # Model Terms (type: integer, default: see below)
}
The default value of \code{num_terms} depends on the number of predictor
columns. For a data frame \code{x}, the default is
\code{min(200, max(20, 2 * ncol(x))) + 1} (see
\code{\link[earth:earth]{earth::earth()}} and the reference below).
}
\subsection{Translation from parsnip to the original package (regression)}{
The \strong{baguette} extension package is required to fit this model.
\if{html}{\out{<div class="sourceCode r">}}\preformatted{bag_mars(num_terms = integer(1), prod_degree = integer(1), prune_method = character(1)) \%>\%
set_engine("earth") \%>\%
set_mode("regression") \%>\%
translate()
}\if{html}{\out{</div>}}
\if{html}{\out{<div class="sourceCode">}}\preformatted{## 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")
}\if{html}{\out{</div>}}
}
\subsection{Translation from parsnip to the original package (classification)}{
The \strong{baguette} extension package is required to fit this model.
\if{html}{\out{<div class="sourceCode r">}}\preformatted{library(baguette)
bag_mars(
num_terms = integer(1),
prod_degree = integer(1),
prune_method = character(1)
) \%>\%
set_engine("earth") \%>\%
set_mode("classification") \%>\%
translate()
}\if{html}{\out{</div>}}
\if{html}{\out{<div class="sourceCode">}}\preformatted{## 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")
}\if{html}{\out{</div>}}
}
\subsection{Preprocessing requirements}{
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 \code{\link[=fit.model_spec]{fit()}}, parsnip will
convert factor columns to indicators.
}
\subsection{Case weights}{
This model can utilize case weights during model fitting. To use them,
see the documentation in \link{case_weights} and the examples
on \code{tidymodels.org}.
The \code{fit()} and \code{fit_xy()} arguments have arguments called
\code{case_weights} that expect vectors of case weights.
Note that the \code{earth} package documentation has: “In the current
implementation, \emph{building models with weights can be slow}.”
}
\subsection{References}{
\itemize{
\item Breiman, L. 1996. “Bagging predictors”. Machine Learning. 24 (2):
123-140
\item Friedman, J. 1991. “Multivariate Adaptive Regression Splines.” \emph{The
Annals of Statistics}, vol. 19, no. 1, pp. 1-67.
\item Milborrow, S. \href{http://www.milbo.org/doc/earth-notes.pdf}{“Notes on the earth package.”}
\item Kuhn, M, and K Johnson. 2013. \emph{Applied Predictive Modeling}. Springer.
}
}
}
\keyword{internal}