Skip to content

Commit

Permalink
Merge branch 'master' into s3params_compat
Browse files Browse the repository at this point in the history
  • Loading branch information
mb706 committed Feb 28, 2024
2 parents a2815fb + 0eb9f48 commit 9e293c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mlr3tuning (development version)

* Compatibility with new paradox version 1.0.0.
* fix: `TunerIrace` failed with logical parameters and dependencies.

# mlr3tuning 0.19.2

Expand Down
1 change: 1 addition & 0 deletions R/Tuner.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Tuner = R6Class("Tuner",
#' @return [data.table::data.table()]
optimize = function(inst) {
assert_multi_class(inst, c("TuningInstanceSingleCrit", "TuningInstanceMultiCrit"))
inst$archive$start_time = Sys.time()
inst$.__enclos_env__$private$.context = ContextOptimization$new(instance = inst, optimizer = self)
call_back("on_optimization_begin", inst$callbacks, get_private(inst)$.context)

Expand Down
6 changes: 4 additions & 2 deletions R/TunerIrace.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ target_runner_tuning = function(experiment, exec.target.runner, scenario, target
# add configuration and instance id to archive
set(configuration, j = "configuration", value = e$id.configuration)
set(configuration, j = "instance", value = e$id.instance)
# fix logicals
configuration[, map(.SD, function(x) ifelse(x %in% c("TRUE", "FALSE"), as.logical(x), x))]
configuration
})
# fix logicals
lgl_params = as.data.table(tuning_instance$search_space)[class == "ParamLgl", id]
if (length(lgl_params)) xdt[, (lgl_params) := lapply(.SD, as.logical), .SDcols = lgl_params]

# provide experiment instances to objective
tuning_instance$objective$constants$values$resampling = map(experiment, function(e) e$instance)
Expand Down

0 comments on commit 9e293c8

Please sign in to comment.