The write_model function (opposed to the write_output) is a
generic wrapper to writing a DistributionModel to disk. It is essentially
a wrapper to saveRDS. Models can be loaded again via the load_model
function.
Arguments
- mod
Provided
DistributionModelobject.- fname
A
characterdepicting an output filename.- slim
A
logicaloption to whether unnecessary entries in the model object should be deleted. This deletes for example predictions or any other non-model content from the object (Default:FALSE).- verbose
logicalindicating whether messages should be shown. OverwritesgetOption("ibis.setupmessages")(Default:TRUE).
Examples
if (FALSE) { # \dontrun{
x <- distribution(background) |>
add_biodiversity_poipo(virtual_points, field_occurrence = 'observed', name = 'Virtual points') |>
add_predictors(pred_current, transform = 'scale',derivates = 'none') |>
engine_xgboost(nrounds = 2000) |> train(varsel = FALSE, only_linear = TRUE)
write_model(x, "testmodel.rds")
} # }
