Load a series of files output of fit_net_clogit models and put them on a bag
Source:R/bag_load_models.R
bag_load_models.Rd
Load a series of files output of fit_net_clogit models and put them on a bag
Usage
bag_load_models(
data,
load_models_path = ".",
load_models_pattern = NULL,
names_from_file = FALSE,
name_from_file_pattern = "Resample",
verbose = FALSE
)
Arguments
- data
[data.frame,tibble]
Complete data set analyzed.- load_models_path
[string="."]
Path to the folder where the files are saved.- load_models_pattern
[string="."]
Pattern common to the file names, to be used ingrep()
to find the files within the folderload_models_path
. It should be the pattern present in the argumentout_dir_file
infit_net_clogit()
orbag_fit_net_clogit()
functions.- names_from_file
[logical(1)=TRUE]
IfFALSE
(default), the names of the resamples are taken from thesamples
parameter. IfTRUE
, they are taken from the files names, instead. In this case, the string defined by the parametername_from_file_pattern
is used to identify the number of each resample.- name_from_file_pattern
[string="Resample"]
String used to separate the file name and identify the number of the resample of each model in the bag, when they are read from files.The parameters metric, standardize, and method should be same ones used to fit the bag of models.
- f
[formula]
Formula of the models fitted, with all possible candidate terms.- samples
[list]
List of samples with at least three elements: train, test, and validate. Each elements might have several elements, each representing the lines ofdata
to be sampled for each resample. Typically, this is computed by the functioncreate_resamples()
.