Closed mb706 closed 4 months ago
is the row order in the benchmark result just coincidental and depends on the hash of objects? in this case, I would adapt this specific test to be row order independent.
Yes, this is a bad test; you should reorder the names (as you already did in this draft) and then not rely on the order, e.g.:
trained = bmr$learners$learner
ii = which(map_lgl(trained, function(x) "cp" %in% names(x$param_set$values))) # find learner with cp
expect_count(ii)
expect_equal(trained[[ii]]$param_set$values, list(xval = 0, minsplit = 12, cp = 0.1))
expect_equal(trained[[-ii]]$param_set$values, list(xval = 0, minsplit = 12, minbucket = 2))
@mllg this one can be merged
@mllg this fails with the new paradox version in this test: https://github.com/mlr-org/mlr3/blob/78ad4dd439bdc7ebfa2ca327eb6cb6e08c424e16/tests/testthat/test_benchmark.R#L473-L477
However, I don't get it: the
param_values
argument in thedesign
islist(cp = 0.1)
for the first learner, yet the test expectscp = 0.1
in the second row of the result. Why is that?