-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Depends and extra trafo #413
Comments
This is exactly what dependencies do: if the dependency is not fulfilled, the entry in the generated configuration list is NULL.
In By the way: When you are only changing values for individual parameters (without any interactions with other values), you can use the search_space = ps(
pca_branch.selection = p_fct(c("nop_pca", "pca")),
pca_id.scale = p_fct(c("1", "2"), depends = pca_branch.selection == "pca",
trafo = function(x) if (x == "1") TRUE else FALSE)
) By the way x2 combo: If all you want to do is get specific discrete values from a finite set, you can use search_space = ps(
pca_branch.selection = p_fct(c("nop_pca", "pca")),
pca_id.scale = p_fct(list(`1` = TRUE, `2` = FALSE), depends = pca_branch.selection == "pca")
) For small ParamSets, you can use generate_design_grid(search_space, 2)
#> <Design> with 3 rows:
#> pca_branch.selection pca_id.scale
#> <char> <char>
#> 1: nop_pca <NA>
#> 2: pca 1
#> 3: pca 2
generate_design_grid(search_space, 2)$transpose()
#> [[1]]
#> [[1]]$pca_branch.selection
#> [1] "nop_pca"
#>
#>
#> [[2]]
#> [[2]]$pca_branch.selection
#> [1] "pca"
#>
#> [[2]]$pca_id.scale
#> [1] TRUE
#>
#>
#> [[3]]
#> [[3]]$pca_branch.selection
#> [1] "pca"
#>
#> [[3]]$pca_id.scale
#> [1] FALSE |
I am confused about paradox behaviour with dependency and extra_trafo.
Here is my reprex:
This returns an error
Now, it seems to me the reason fro the error is that in case search space chosees non pca there is no pca scale parameter availabel. IS that TRUE? Should I always check for NULL too?
The text was updated successfully, but these errors were encountered: