Skip to content

Commit 652fa40

Browse files
authored
fix batchmark for new batchtools version (mlr-org#2067)
* fix batchmark for new batchtools version * fix whitespaces
1 parent 7eef4ef commit 652fa40

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

R/batchmark.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ reduceBatchmarkResults = function(ids = NULL, keep.pred = TRUE, show.info = getM
108108
warning("Collecting results for a subset of jobs. The resulting BenchmarkResult may be misleading.")
109109

110110
problem = algorithm = NULL # for data.table's NSE
111-
tab = batchtools::getJobPars(ids, flatten = FALSE, reg = reg)[, c("job.id", "problem", "algorithm")]
111+
tab = batchtools::getJobPars(ids, reg = reg)[, c("job.id", "problem", "algorithm")]
112112
setkeyv(tab, cols = c("problem", "algorithm"), physical = FALSE)
113113
result = namedList(tab[, unique(problem)])
114114

tests/testthat/test_base_batchmark.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ test_that("batchmark", {
1919
expect_data_table(ids, ncol = 1L, nrow = 2, key = "job.id")
2020
expect_set_equal(ids$job.id, 1:2)
2121
tab = summarizeExperiments(reg = reg)
22-
expect_equal(tab$problem, as.factor("binary"))
23-
expect_equal(tab$algorithm, as.factor("classif.lda"))
22+
expect_equal(tab$problem, "binary")
23+
expect_equal(tab$algorithm, "classif.lda")
2424
expect_set_equal(findExperiments(reg = reg)$job.id, 1:2)
2525

2626
submitJobs(reg = reg)

tests/testthat/test_base_generateFilterValuesData.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ test_that("filterFeatures", {
6161

6262
test_that("plotFilterValues", {
6363
filter.methods = listFilterMethods(tasks = TRUE)
64-
64+
6565
filter.classif = as.character(filter.methods[filter.methods$task.classif == TRUE, "id"])
6666
filter.classif = setdiff(filter.classif, "permutation.importance") # this filter needs additional arguments
6767

6868
fv = generateFilterValuesData(binaryclass.task, method = filter.classif)
6969
plotFilterValues(fv)
7070

7171
filter.regr = as.character(filter.methods[filter.methods$task.regr == TRUE & filter.methods$task.classif == FALSE, "id"])
72-
72+
7373
fv = generateFilterValuesData(regr.num.task, method = filter.regr)
7474
plotFilterValues(fv)
7575

0 commit comments

Comments
 (0)