Skip to content
Hao Wang edited this page Sep 27, 2020 · 7 revisions

Welcome to the bayes-optim wiki!

Creating the Search Space

Generally,

bounds : (list of) list, lower and upper bound for continuous/ordinal parameter type categorical values for nominal parameter type. The dimension of the space is determined by the length of the nested list var_name : (list of) str, variable name per dimension. If only a string is given for multiple dimensions, variable names are created by appending counting numbers to the input string.

Real-valued variables

from bayes_optim import ContinuousSpace

n = 2
# Continuous variables can be specified as follows:
# for n real-valued variable in [-5, 5]^n
# for n variables, the naming scheme is continuous0, continuous1
C = ContinuousSpace([-5, 5], var_name='continuous') * n
print(C.var_names)

# Equivalently, you can also use
# C = ContinuousSpace([[-5, 5]]] * n) 

# The general usage is:
# ContinuousSpace([[lb_1, ub_1], [lb_2, ub_2], ..., [lb_n, ub_n]]) 

Real-valued variables

Integer (ordinal) variables can be specified as

  • bounds: the domain of integer variables can be given as with continuous ones
  • var_name is optional
from bayes_optim import OrdinalSpace
I = OrdinalSpace([5, 15], var_name='ordinal')

Clone this wiki locally