Skip to content

Commit a024f53

Browse files
authored
refactor(objective): use the extract_runtime() helper (#193)
`ObjectiveFSelectBatch` open-coded the same summation over the learner states that `extract_runtime()` in `R/helper.R` performs, and the helper was only called from `ObjectiveFSelectAsync`.
1 parent 738fcc5 commit a024f53

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

R/ObjectiveFSelectBatch.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,7 @@ ObjectiveFSelectBatch = R6Class(
105105
lg$debug("Aggregated performance %s", as_short_string(private$.aggregated_performance))
106106

107107
# add runtime to evaluations
108-
time = map_dbl(private$.benchmark_result$resample_results$resample_result, function(rr) {
109-
sum(map_dbl(get_private(rr)$.data$learner_states(get_private(rr)$.view), function(state) {
110-
state$train_time + state$predict_time
111-
}))
112-
})
108+
time = map_dbl(private$.benchmark_result$resample_results$resample_result, extract_runtime)
113109
set(private$.aggregated_performance, j = "runtime_learners", value = time)
114110

115111
# store benchmark result in archive

0 commit comments

Comments
 (0)