Nothing
#' @title Backup Archive Callback
#'
#' @include CallbackOptimization.R
#' @name bbotk.backup
#'
#' @description
#' This [CallbackOptimization] writes the [Archive] after each batch to disk.
#'
#' @examples
#' clbk("bbotk.backup", path = "backup.rds")
NULL
load_callback_backup = function() {
callback_optimization("bbotk.backup",
label = "Backup Archive Callback",
man = "bbotk::bbotk.backup",
on_optimization_begin = function(callback, context) {
assert_path_for_output(callback$state$path)
},
on_optimizer_after_eval = function(callback, context) {
if (file.exists(callback$state$path)) unlink(callback$state$path)
saveRDS(context$instance$archive$data, callback$state$path)
},
fields = list(path = "archive.rds")
)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.