# NOT RUN {
params = ps(
unbounded_integer = p_int(),
bounded_double = p_dbl(0, 10),
half_bounded_integer = p_dbl(1),
half_bounded_double = p_dbl(upper = 1),
double_with_trafo = p_dbl(-1, 1, trafo = exp),
extra_double = p_dbl(0, 1, special_vals = list("xxx"), tags = "tagged"),
factor_param = p_fct(c("a", "b", "c")),
factor_param_with_implicit_trafo = p_fct(list(a = 1, b = 2, c = list()))
)
print(params)
params$trafo(list(
bounded_double = 1,
double_with_trafo = 1,
factor_param = "c",
factor_param_with_implicit_trafo = "c"
))
# logscale:
params = ps(x = p_dbl(1, 100, logscale = TRUE))
# The ParamSet has bounds log(1) .. log(100):
print(params)
# When generating a equidistant grid, it is equidistant within log values
grid = generate_design_grid(params, 3)
print(grid)
# But the values are on a log scale with desired bounds after trafo
print(grid$transpose())
# Integer parameters with logscale are `ParamDbl`s pre-trafo
params = ps(x = p_int(0, 10, logscale = TRUE))
print(params)
grid = generate_design_grid(params, 4)
print(grid)
# ... but get transformed to integers.
print(grid$transpose())
# }
Run the code above in your browser using DataLab