docstr: Implements a random search across the search space for comparison.
  Candidates are sampled at random and run on the maximum budget.
  
  Parameters
  ----------
  configspace: ConfigSpace object
          valid representation of the search space
  eta : float
          In each iteration, a complete run of sequential halving is executed. In it,
          after evaluating each configuration on the same subset size, only a fraction of
          1/eta of them 'advances' to the next round.
          Must be greater or equal to 2.
  budget : float
          budget for the evaluation
docstr_tok: ["Implements","a","random","search","across","the","search","space","for","comparison",".","Candidates","are","sampled","at","random","and","run","on","the","maximum","budget",".","Parameters","--","--","--","--","--","configspace",":","ConfigSpace","object","valid","representation","of","the","search","space","eta",":","float","In","each","iteration",",","a","complete","run","of","sequential","halving","is","executed",".","In","it",",","after","evaluating","each","configuration","on","the","same","subset","size",",","only","a","fraction","of","1\/eta","of","them","'advances","'","to","the","next","round",".","Must","be","greater","or","equal","to","2.","budget",":","float","budget","for","the","evaluation"]
code: def __init__(
      self,
      configspace=None,
      eta=3,
      min_budget=1,
      max_budget=1,
      **kwargs,
  ):
      """
      Implements a random search across the search space for comparison.
      Candidates are sampled at random and run on the maximum budget.
  
      Parameters
      ----------
      configspace: ConfigSpace object
              valid representation of the search space
      eta : float
              In each iteration, a complete run of sequential halving is executed. In it,
              after evaluating each configuration on the same subset size, only a fraction of
              1/eta of them 'advances' to the next round.
              Must be greater or equal to 2.
      budget : float
              budget for the evaluation
      """
  
      # TODO: Propper check for ConfigSpace object!
      if configspace is None:
          raise ValueError(
              "You have to provide a valid ConfigSpace object"
          )
  
      cg = RS(configspace=configspace)
  
      super().__init__(config_generator=cg, **kwargs)
  
      # Hyperband related stuff
      self.eta = eta
      self.min_budget = max_budget
      self.max_budget = max_budget
  
      # precompute some HB stuff
      self.max_SH_iter = (
          -int(np.log(min_budget / max_budget) / np.log(eta)) + 1
      )
      self.budgets = max_budget * np.power(
          eta, -np.linspace(self.max_SH_iter - 1, 0, self.max_SH_iter)
      )
  
      # max total budget for one iteration
      self.budget_per_iteration = sum(
          [b * self.eta**i for i, b in enumerate(self.budgets[::-1])]
      )
  
      self.config.update(
          {
              "eta": eta,
              "min_budget": max_budget,
              "max_budget": max_budget,
          }
      )
  
file_path: auptimizer/src/aup/Proposer/hpbandster/optimizers/randomsearch.py
imports: import os
  import time
  import math
  import copy
  import logging
  import numpy
  import ConfigSpace
  from hpbandster.core.master import Master
  from hpbandster.optimizers.iterations import SuccessiveHalving
  from hpbandster.optimizers.config_generators.random_sampling import RandomSampling
label_desc: Use image node_id 1 to create a new RandomSearch object from inherited base classes: Master with example: obj = RandomSearch(configspace, eta, min_budget, max_budget)