class_docstr: Bayesian Optimization with HyperBand
  
  This class is a wrapper around the library HpBandSter:
  https://github.com/automl/HpBandSter.
  
  For more information on the algorithm,
  see original paper at https://arxiv.org/abs/1807.01774.
  
  Falkner, Stefan, Aaron Klein, and Frank Hutter. "BOHB: Robust and efficient hyperparameter
  optimization at scale." In International Conference on Machine Learning, pp. 1437-1446. PMLR,
  2018.
  
  Parameters
  ----------
  space: `orion.algo.space.Space`
      Optimisation space with priors for each dimension.
  seed: None, int or sequence of int
      Seed for the random number generator used to sample new trials.
      Default: ``None``
  min_points_in_model: int
      Number of observations to start building a KDE. If ``None``, uses number
      of dimensions in the search space + 1. Default: ``None``
  top_n_percent: int
      Percentage ( between 1 and 99) of the observations that are considered good. Default: 15
  num_samples: int
      Number of samples to optimize Expected Improvement. Default: 64
  random_fraction: float
      Fraction of purely random configurations that are sampled from the
      prior without the model. Default: 1/3
  bandwidth_factor: float
      To encourage diversity, the points proposed to optimize EI, are sampled
      from a 'widened' KDE where the bandwidth is multiplied by this factor. Default: 3
  min_bandwidth: float
      To keep diversity, even when all (good) samples have the same value
      for one of the parameters, a minimum bandwidth is used instead of
      zero. Default: 1e-3
  parallel_strategy: dict or None, optional
      The configuration of a parallel strategy to use for pending trials or broken trials.
      Default is a MaxParallelStrategy for broken trials and NoParallelStrategy for pending
      trials.
class_docstr_tok: ["Bayesian","Optimization","with","HyperBand","This","class","is","a","wrapper","around","the","library","HpBandSter",":","https",":","\/\/github.com\/automl\/HpBandSter",".","For","more","information","on","the","algorithm",",","see","original","paper","at","https",":","\/\/arxiv.org\/abs\/1807.01774",".","Falkner",",","Stefan",",","Aaron","Klein",",","and","Frank","Hutter",".","``","BOHB",":","Robust","and","efficient","hyperparameter","optimization","at","scale",".","''","In","International","Conference","on","Machine","Learning",",","pp",".","1437-1446",".","PMLR",",","2018",".","Parameters","--","--","--","--","--","space",":","`","orion.algo.space.Space","`","Optimisation","space","with","priors","for","each","dimension",".","seed",":","None",",","int","or","sequence","of","int","Seed","for","the","random","number","generator","used","to","sample","new","trials",".","Default",":","``","None","``","min_points_in_model",":","int","Number","of","observations","to","start","building","a","KDE",".","If","``","None","``",",","uses","number","of","dimensions","in","the","search","space","+","1",".","Default",":","``","None","``","top_n_percent",":","int","Percentage","(","between","1","and","99",")","of","the","observations","that","are","considered","good",".","Default",":","15","num_samples",":","int","Number","of","samples","to","optimize","Expected","Improvement",".","Default",":","64","random_fraction",":","float","Fraction","of","purely","random","configurations","that","are","sampled","from","the","prior","without","the","model",".","Default",":","1\/3","bandwidth_factor",":","float","To","encourage","diversity",",","the","points","proposed","to","optimize","EI",",","are","sampled","from","a","'widened","'","KDE","where","the","bandwidth","is","multiplied","by","this","factor",".","Default",":","3","min_bandwidth",":","float","To","keep","diversity",",","even","when","all","(","good",")","samples","have","the","same","value","for","one","of","the","parameters",",","a","minimum","bandwidth","is","used","instead","of","zero",".","Default",":","1e-3","parallel_strategy",":","dict","or","None",",","optional","The","configuration","of","a","parallel","strategy","to","use","for","pending","trials","or","broken","trials",".","Default","is","a","MaxParallelStrategy","for","broken","trials","and","NoParallelStrategy","for","pending","trials","."]
docstr: Suggest a number of new sets of parameters.
  
  Parameters
  ----------
  num: int, optional
      Number of trials to suggest. The algorithm may return less than the number of trials
      requested.
  
  Returns
  -------
  list of trials or None
      A list of trials representing values suggested by the algorithm. The algorithm may opt
      out if it cannot make a good suggestion at the moment (it may be waiting for other
      trials to complete), in which case it will return None.
  
  
  Notes
  -----
  New parameters must be compliant with the problem's domain `orion.algo.space.Space`.
docstr_tok: ["Suggest","a","number","of","new","sets","of","parameters",".","Parameters","--","--","--","--","--","num",":","int",",","optional","Number","of","trials","to","suggest",".","The","algorithm","may","return","less","than","the","number","of","trials","requested",".","Returns","--","--","--","-","list","of","trials","or","None","A","list","of","trials","representing","values","suggested","by","the","algorithm",".","The","algorithm","may","opt","out","if","it","can","not","make","a","good","suggestion","at","the","moment","(","it","may","be","waiting","for","other","trials","to","complete",")",",","in","which","case","it","will","return","None",".","Notes","--","--","-","New","parameters","must","be","compliant","with","the","problem","'s","domain","`","orion.algo.space.Space","`","."]
code: def suggest(self, num):
      """Suggest a number of new sets of parameters.
  
      Parameters
      ----------
      num: int, optional
          Number of trials to suggest. The algorithm may return less than the number of trials
          requested.
  
      Returns
      -------
      list of trials or None
          A list of trials representing values suggested by the algorithm. The algorithm may opt
          out if it cannot make a good suggestion at the moment (it may be waiting for other
          trials to complete), in which case it will return None.
  
  
      Notes
      -----
      New parameters must be compliant with the problem's domain `orion.algo.space.Space`.
  
      """
  
      def run_to_trial(run):
          params = transform(run[1])
          params[self.fidelity_index] = run[2]
          return dict_to_trial(params, self.space)
  
      def sample_iteration(iteration, trials):
          while len(trials) < num and not iteration.is_finished:
              run = iteration.get_next_run()
              if run is None:
                  break
              new_trial = run_to_trial(run)
  
              # This means the job was already suggested and we have a result
              result = self.trial_results.get(
                  self.get_id(new_trial), None
              )
              if result is not None:
                  job = FakeJob(run, new_trial)
                  job.result["loss"] = result
                  iteration.register_result(job)
                  self.bohb.new_result(job)
                  continue
  
              self.trial_meta.setdefault(
                  self.get_id(new_trial), []
              ).append(run)
              self.register(new_trial)
              trials.append(new_trial)
  
      trials = []
      for it in self.iterations:
          sample_iteration(it, trials)
      # If we don't have enough trials and there are still
      # some iterations left
      if self.iteration < len(self.budgets):
          self.iterations.append(self._make_iteration(self.iteration))
          self.iteration += 1
          sample_iteration(self.iterations[-1], trials)
  
      return trials
  
imports: import copy
  import numpy
  from orion.algo.base import BaseAlgorithm
  from orion.algo.base.parallel_strategy import strategy_factory
  from orion.algo.space import Fidelity
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.utils.module_import import ImportOptional
label_desc: Use image node_id 7 for calling the BOHB obj's underlying member method code with example usage: obj.suggest(num) and returns: trials, dict_to_trial