-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #201: focussearch now handles discrete vector parameters (cont.) #257
base: main
Are you sure you want to change the base?
Conversation
also general focussearch bugfixes
Parameters that have discrete vector params in their requirement can not be handled by infillOptFocus, so trying to do that now gives an error.
to.del = sample(val.names, 1) | ||
newmap = newmap[newmap != to.del] | ||
names(newmap) = names(par$values) | ||
discrete.vector.mapping[[dfindex]] <<- newmap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<<-?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need the updated discrete.vector.mapping
outside of the lapply
if (par$type %nin% c("discretevector", "logicalvector")) { | ||
val.names = names(par$values) | ||
# remove current val from delete options, should work also for NA | ||
val.names = val.names[!sapply(par$values, identical, y=val)] # remember, 'val' can be any type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vlapply
} | ||
} else if (isDiscrete(par)) { | ||
# randomly drop a level, which is not val | ||
if (length(par$values) <= 1L) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== 0
@@ -68,13 +68,18 @@ test_that("complex param space, dependencies, focusing, restarts", { | |||
if(x$disc2 == 'a') tmp3 = log(x$realA) + x$intA^4 + ifelse(x$discA == 'm', 5, 0) | |||
if(x$disc2 == 'b') tmp3 = exp(x$realB) + ifelse(x$discB == 'R', sin(x$realBR), sin(x$realBNR)) | |||
if(x$disc2 == "c") tmp3 = 500 | |||
assert(is.list(x$discVec)) | |||
assert(x$discVec[[1]] %in% c("a", "b", "c")) | |||
assert(x$discScal %in% c("x", "y", "z")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what assert is for. Use expect_is/expect_true and expect_subset
i will take this now. |
15b7e6c
to
9108ff2
Compare
9108ff2
to
d167503
Compare
Just had a look, a) general look/review afaik good2go now (if travis is green) |
0febb72
to
a1eb197
Compare
ping @berndbischl |
c3cfc07
to
9648acf
Compare
this is really not so good what happens here:
|
Okay. So we are waiting for the PR in ParamHelpers for "splitVectorParamsFunction" and then we will refactor the code. |
9648acf
to
15b7e6c
Compare
I was not able to take over PR #202 and keep it there. But I was able to pull the branch here it is