Skip to content

Commit

Permalink
compatible with both paradox
Browse files Browse the repository at this point in the history
  • Loading branch information
mb706 committed Jan 14, 2024
1 parent 3b5fd68 commit 5063933
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/helper.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
measures_to_codomain = function(measures) {
measures = as_measures(measures)
domains = map(measures, function(s) {
p_dbl(tags = ifelse(s$minimize, "minimize", "maximize"))
if ("set_id" %in% names(ps())) {
# old paradox
ParamDbl$new(id = s$id, tags = ifelse(s$minimize, "minimize", "maximize"))
} else {
p_dbl(tags = ifelse(s$minimize, "minimize", "maximize"))
}
})
names(domains) = ids(measures)
Codomain$new(ParamSet$new(domains))
Codomain$new(domains)
}

extract_benchmark_result_learners = function(bmr) {
Expand Down

0 comments on commit 5063933

Please sign in to comment.