fit()
and fit_xy()
substitute the current arguments in the model
specification into the computational engine's code, checks them
for validity, then fits the model using the data and the
engine-specific code. Different model functions have different
interfaces (e.g. formula or x
/y
) and these functions translate
between the interface used when fit()
or fit_xy()
were invoked and the one
required by the underlying model.
When possible, these functions attempt to avoid making copies of the
data. For example, if the underlying model uses a formula and
fit()
is invoked, the original data are references
when the model is fit. However, if the underlying model uses
something else, such as x
/y
, the formula is evaluated and
the data are converted to the required format. In this case, any
calls in the resulting model objects reference the temporary
objects used to fit the model.
If the model engine has not been set, the model's default engine will be used
(as discussed on each model page). If the verbosity
option of
control_parsnip()
is greater than zero, a warning will be produced.