Skip to content

Commit 95bebb9

Browse files
committed
test: fix test_ResultAssignerArchive due to upcoming changes of internal tuned values in mlr3tuning 1.3.1
1 parent 6c0b2f9 commit 95bebb9

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

NEWS.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# mlr3mbo (development version)
22

3+
* chore: silence rush logger and fixed some partial matches, depend on mlr3 >= 0.22.1.
4+
* test: fix `test_AcqFunctionMulti`, robustify helper and loading.
5+
* test: fix `test_ResultAssignerArchive` due to upcoming changes of internal tuned values in mlr3tuning 1.3.1
6+
37
# mlr3mbo 0.2.8
48

59
* docs: gracefully exit examples of `OptimizerAsyncMbo`, `OptimizerADBO`, `TunerAsyncMbo`, and `TunerADBO` if Redis is not available.
@@ -15,22 +19,22 @@
1519

1620
# mlr3mbo 0.2.6
1721

18-
* refactor: Extract internal tuned values in instance.
22+
* refactor: extract internal tuned values in instance.
1923

2024
# mlr3mbo 0.2.5
2125

22-
* docs: Move vignette to mlr3book.
23-
* feat: Add `AcqFunctionMulti` that can wrap multiple acquisition functions resulting in a multi-objective acquisition function problem.
24-
* feat: Support callbacks in `AcqOptimizer`.
25-
* feat: Allow `AcqFunctionEI` to be adjusted by epsilon to strengthen exploration.
26+
* docs: move vignette to mlr3book.
27+
* feat: add `AcqFunctionMulti` that can wrap multiple acquisition functions resulting in a multi-objective acquisition function problem.
28+
* feat: support callbacks in `AcqOptimizer`.
29+
* feat: allow `AcqFunctionEI` to be adjusted by epsilon to strengthen exploration.
2630

2731
# mlr3mbo 0.2.4
2832

29-
* fix: Improve runtime of `AcqOptimizer` by setting `check_values = FALSE`.
33+
* fix: improve runtime of `AcqOptimizer` by setting `check_values = FALSE`.
3034

3135
# mlr3mbo 0.2.3
3236

33-
* compatibility: Work with new bbotk and mlr3tuning version 1.0.0.
37+
* compatibility: work with new bbotk and mlr3tuning version 1.0.0.
3438

3539
# mlr3mbo 0.2.2
3640

@@ -70,8 +74,8 @@
7074
# mlr3mbo 0.1.2
7175

7276
* refactor: adapt to mlr3tuning 0.18.0.
73-
* feat: Acquisition functions now assert whether surrogates match their required predict type.
74-
* fix: Unloading `mlr3mbo` removes optimizers and tuners from the dictionaries.
77+
* feat: acquisition functions now assert whether surrogates match their required predict type.
78+
* fix: unloading `mlr3mbo` removes optimizers and tuners from the dictionaries.
7579
* docs: faster examples.
7680
* feat: characters in surrogate regression tasks are no longer automatically converted to factors.
7781
`default_surrogate` now respects this and gained an appropriate pipeline step.

tests/testthat/test_ResultAssignerArchive.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,24 @@ test_that("ResultAssignerArchive passes internal tuned values", {
6161
validate = 0.2,
6262
early_stopping = TRUE,
6363
x = to_tune(0.2, 0.3),
64-
iter = to_tune(upper = 1000, internal = TRUE, aggr = function(x) 99))
64+
iter = to_tune(upper = 1000L, internal = TRUE, aggr = function(x) 99L))
6565

6666
instance = ti(
6767
task = tsk("pima"),
6868
learner = learner,
69-
resampling = rsmp("cv", folds = 3),
69+
resampling = rsmp("cv", folds = 3L),
7070
measures = msr("classif.ce"),
71-
terminator = trm("evals", n_evals = 20),
71+
terminator = trm("evals", n_evals = 20L),
7272
store_benchmark_result = TRUE
7373
)
7474
surrogate = SurrogateLearner$new(REGR_KM_DETERM)
7575
acq_function = AcqFunctionEI$new()
7676
acq_optimizer = AcqOptimizer$new(opt("random_search", batch_size = 2L), terminator = trm("evals", n_evals = 2L))
7777

7878
tuner = tnr("mbo", result_assigner = result_assigner)
79-
expect_data_table(tuner$optimize(instance), nrows = 1)
80-
expect_list(instance$archive$data$internal_tuned_values, len = 20, types = "list")
81-
expect_equal(instance$archive$data$internal_tuned_values[[1]], list(iter = 99))
79+
expect_data_table(tuner$optimize(instance), nrows = 1L)
80+
expect_list(instance$archive$data$internal_tuned_values, len = 20L, types = "list")
81+
expect_equal(instance$archive$data$internal_tuned_values[[1L]]$iter, 99L)
8282
expect_false(instance$result_learner_param_vals$early_stopping)
83-
expect_equal(instance$result_learner_param_vals$iter, 99)
83+
expect_equal(instance$result_learner_param_vals$iter, 99L)
8484
})

0 commit comments

Comments
 (0)