Wrap Model$fit()
to fit, validate and store multiple models
training_camp.Rd
Given a data set and a list of Model
s, call Model$fit()
for
all of them. If an error occurs while fitting a model, you can skip to the next
model.
Usage
training_camp(
model_list,
data,
skip_on_error = TRUE,
update_model_shell = FALSE,
quiet = FALSE
)
Arguments
- model_list
list of
Model
objects. The models to fit.- data
Data object. Its
cohort
attribute must be set. Fit the models to thecohort
ofdata
.- skip_on_error
logical. Whether to skip to the next model if an error occurs while fitting a model.
- update_model_shell
logical. If
TRUE
and, for aModel
inmodel_list
, we find a stored version withfit_obj
not beingNULL
, we set thefit_obj
attribute of theModel
to the foundfit_obj
and save it. This way, we can update the model shell, which we want to do if changes were made to theModel
class.- quiet
logical. Whether to suppress messages. Default is
FALSE
.