A function to train and predict crossvalidation folds and train one full
model and predict any external validation data. This function is primarily
used internally but can be used when running workflows interactively (see
vignette basic zoon useage
)
RunModels(df, modelFunction, paras, workEnv)
df | Dataframe from process module. Should contain columns value, type, lon, lat and fold, a number indicating which cross validation set a datapoint is in. If fold is 0 then this is considered external validation data If all data is 0 or 1, then no cross validation is run. |
---|---|
modelFunction | String giving the name of the model function which is in turn the name of the module. |
paras | All other parameters that should be passed to the model function. i.e. model[[1]]$paras |
workEnv | The environment name of the workflow call environment. |
A list of length 2 containing the model trained on all data and a data.frame which contains value, type, fold, lon, lat, predictions and then all environmental variables.