Helper function to define a continuous floating point hyperparameter range for Bayesian optimization.
opt_float(low, high, log = FALSE, step = NULL)Numeric. The lower bound of the range.
Numeric. The upper bound of the range.
Logical. If TRUE, the value is sampled from the range in the log domain.
Useful for parameters like learning rates or regularization (alpha, gamma).
Numeric or NULL. The discretization step. If provided, the value will be rounded to the nearest multiple of step.
An object of class "opt_param_def" defining the search strategy.
# Define a log-scale search for alpha between 0.001 and 100
space_alpha <- opt_float(0.001, 100, log = TRUE)