docstr: Set up a study for advisor.
  config: [{
      "parameterName": "num_layers",
      "type": "DISCRETE",
      "feasiblePoints": "1,2,3,4",
  },{
      "parameterName": "dropout",
      "type": "DOUBLE",
      "minValue": 0.1,
      "maxValue": 0.9,
      "scalingType": "LINEAR"
  }]
code: def set_space(self, config):
      """
      Set up a study for advisor.
      config: [{
          "parameterName": "num_layers",
          "type": "DISCRETE",
          "feasiblePoints": "1,2,3,4",
      },{
          "parameterName": "dropout",
          "type": "DOUBLE",
          "minValue": 0.1,
          "maxValue": 0.9,
          "scalingType": "LINEAR"
      }]"""
      # len = len(config)
      self.arg_name = []
      self.arg_len = []
      self.arg_typ = []
      # len = sum(arg_len)
      self.type_ = []
      self.bound = []
      self.config = {}
      self.id2cate = {}
  
      for para in config:
          if para["type"] == "DOUBLE":
              self.arg_name.append(para["parameterName"])
              self.arg_len.append(1)
              self.arg_typ.append("value")
              self.type_.append(float)
              self.bound.append((para["minValue"], para["maxValue"]))
          elif para["type"] == "INTEGER":
              self.arg_name.append(para["parameterName"])
              self.arg_len.append(1)
              self.arg_typ.append("value")
              self.type_.append(int)
              self.bound.append((para["minValue"], para["maxValue"]))
          elif (
              para["type"] == "DISCRETE"
              or para["type"] == "CATEGORICAL"
          ):
              cate_list = para["feasiblePoints"].split(",")
              cate_list = list(map(lambda x: x.strip(), cate_list))
              cate_len = len(cate_list)
              self.config[para["parameterName"]] = cate_list
              self.id2cate[para["parameterName"]] = {
                  x: y for y, x in enumerate(cate_list)
              }
  
              self.arg_name.append(para["parameterName"])
              self.arg_len.append(cate_len)
              self.arg_typ.append("argmax")
              self.type_.extend([float for i in range(cate_len)])
              self.bound.extend([(0, 1) for i in range(cate_len)])
  
imports: import random
  import os
  import sys
  import collections
  import itertools
  import pickle
  import scipy.sparse
  import networkx
  import numpy
  from sklearn.cluster import SpectralClustering
  from sklearn import gaussian_process
  from scipy.optimize import minimize
  from bayes_opt import BayesianOptimization
label_desc: Use image node_id 2 for calling the Params obj's underlying member method code with example usage: obj.set_space(config) without return types