class_docstr: Asynchronous Successive Halving as described in:
  
      @article{li2018massively,
      title={Massively parallel hyperparameter tuning},
      author={Li, Liam and Jamieson, Kevin and Rostamizadeh, Afshin and Gonina, Ekaterina and Hardt, Moritz and Recht, Benjamin and Talwalkar, Ameet},
      journal={arXiv preprint arXiv:1810.05934},
      year={2018}
      }
  
  Asynchronous successive halving operates based on the multi-armed bandit
  algorithm Successive Halving (SHA) and performs principled early stopping for
  random search.
  
  Args:
      r (int): minimum resource that each configuration will be trained for.
      R (int): maximum resource.
      eta (int): elimination rate.
      s (int): minimum early-stopping rate.
      max_finished_configs (int): stop once max_finished_configs models have
          been trained to completion.
class_docstr_tok: ["Asynchronous","Successive","Halving","as","described","in",":","@","article","{","li2018massively",",","title=","{","Massively","parallel","hyperparameter","tuning","}",",","author=","{","Li",",","Liam","and","Jamieson",",","Kevin","and","Rostamizadeh",",","Afshin","and","Gonina",",","Ekaterina","and","Hardt",",","Moritz","and","Recht",",","Benjamin","and","Talwalkar",",","Ameet","}",",","journal=","{","arXiv","preprint","arXiv:1810.05934","}",",","year=","{","2018","}","}","Asynchronous","successive","halving","operates","based","on","the","multi-armed","bandit","algorithm","Successive","Halving","(","SHA",")","and","performs","principled","early","stopping","for","random","search",".","Args",":","r","(","int",")",":","minimum","resource","that","each","configuration","will","be","trained","for",".","R","(","int",")",":","maximum","resource",".","eta","(","int",")",":","elimination","rate",".","s","(","int",")",":","minimum","early-stopping","rate",".","max_finished_configs","(","int",")",":","stop","once","max_finished_configs","models","have","been","trained","to","completion","."]
docstr: Check to see if there is a promotable configuration. Otherwise,
  return a new configuration.
docstr_tok: ["Check","to","see","if","there","is","a","promotable","configuration",".","Otherwise",",","return","a","new","configuration","."]
code: def get_job(self, parameters, results, lower_is_better):
      """
      Check to see if there is a promotable configuration. Otherwise,
      return a new configuration.
      """
      for k in reversed(range(self.number_of_rungs)):
          candidates = self.top_n(
              parameters, results, lower_is_better, rung=k, eta=self.eta
          )
          # print("RUNG", k, "CANDIDATES\n", candidates)
          promotable = candidates[
              ~candidates.save_to.isin(self.promoted_trials)
          ].to_dict("records")
  
          if len(promotable) > 0:
              self.promoted_trials.add(promotable[0]["save_to"])
              return promotable[0], k + 1
      else:
          new_config = self.rs.get_suggestion(parameters=parameters)
          return new_config, 0
  
file_path: sherpa/sherpa/algorithms/successive_halving.py
imports: from sherpa.algorithms import Algorithm, RandomSearch
  import numpy
  import pandas
  from sherpa.core import TrialStatus, AlgorithmState
label_desc: Use image node_id 4 for calling the SuccessiveHalving obj's underlying member method code with example usage: obj.get_job(parameters, results, lower_is_better) and returns: new_config,  int, promotable,  unknown