Exemplo n.º 1
0
 def convert(search_space, skopt_suggested):
     assignments = []
     for i in range(len(search_space.params)):
         param = search_space.params[i]
         if param.type == INTEGER:
             assignments.append(Assignment(param.name, skopt_suggested[i]))
         elif param.type == DOUBLE:
             assignments.append(Assignment(param.name, skopt_suggested[i]))
         elif param.type == CATEGORICAL or param.type == DISCRETE:
             assignments.append(Assignment(param.name, skopt_suggested[i]))
     return assignments
Exemplo n.º 2
0
 def convert(search_space, vals):
     assignments = []
     for param in search_space.params:
         if param.type == INTEGER:
             assignments.append(Assignment(param.name, int(vals[param.name][0])))
         elif param.type == DOUBLE:
             assignments.append(Assignment(param.name, vals[param.name][0]))
         elif param.type == CATEGORICAL or param.type == DISCRETE:
             assignments.append(
                 Assignment(param.name, param.list[vals[param.name][0]]))
     return assignments
Exemplo n.º 3
0
 def convert(search_space, chocolate_params):
     assignments = []
     for param in search_space.params:
         key = BaseChocolateService.encode(param.name)
         if param.type == INTEGER:
             assignments.append(
                 Assignment(param.name, chocolate_params[key]))
         elif param.type == DOUBLE:
             assignments.append(
                 Assignment(param.name, chocolate_params[key]))
         elif param.type == CATEGORICAL or param.type == DISCRETE:
             assignments.append(
                 Assignment(param.name, param.list[chocolate_params[key]]))
     return assignments