Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 14, 2024
1 parent 5b4cd84 commit d01876c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Imports:
mlr3misc,
uuid
Suggests:
renv,
rpart,
testthat
Encoding: UTF-8
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* feat: `reduceResultsBatchmark` gains argument `fun` which is passed on to `batchtools::reduceResultsList`.
Useful for deleting model data to avoid running out of memory.
Thanks to Toby Dylan Hocking @tdhock for the PR (https://github.com/mlr-org/mlr3batchmark/issues/18).
* docs: A warning is now given when the loaded mlr3 version differs from the mlr3 version stored in the trained learners
* feat: support marshaling
* docs: A warning is now given when the loaded mlr3 version differs from the mlr3 version stored in the trained learners.
* feat: Support marshaling.
* feat: A `renv` project can be passed to `batchmark()` that is loaded in the job environment.

# mlr3batchmark 0.1.1

Expand Down
10 changes: 8 additions & 2 deletions R/batchmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#'
#' @inheritParams mlr3::benchmark
#' @param reg [batchtools::ExperimentRegistry].
#' @param renv_project `character(1)`\cr
#' Path to a renv project.
#' If not `NULL`, the renv project is activated in the job environment.
#'
#' @return [data.table()] with ids of created jobs (invisibly).
#' @export
Expand All @@ -37,8 +40,11 @@ batchmark = function(design, store_models = FALSE, reg = batchtools::getDefaultR
design = as.data.table(assert_data_frame(design, min.rows = 1L))
assert_names(names(design), must.include = c("task", "learner", "resampling"))
assert_flag(store_models)
batchtools::assertRegistry(reg, class = "ExperimentRegistry", writeable = TRUE, sync = TRUE,
running.ok = FALSE)
batchtools::assertRegistry(reg, class = "ExperimentRegistry", writeable = TRUE, sync = TRUE, running.ok = FALSE)
if (!is.null(renv_project)) {
require_namespaces("renv")
assert_directory_exists(renv_project)
}

assert_list(design$task, "Task")
assert_list(design$learner, "Learner")
Expand Down
11 changes: 10 additions & 1 deletion man/batchmark.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d01876c

Please sign in to comment.