class_docstr: A Bayes search Recipe. (Experimental)
docstr: __init__()
  Constructor.
  
  :param num_samples: number of hyper-param configurations sampled
  :param look_back: the length to look back, either a tuple with 2 int values,
    which is in format is (min len, max len), or a single int, which is
    a fixed length to look back.
  :param reward_metric: the rewarding metric value, when reached, stop trial
  :param training_iteration: no. of iterations for training (n epochs) in trials
  :param epochs: no. of epochs to train in each iteration
docstr_tok: ["__init__","(",")","Constructor",".",":","param","num_samples",":","number","of","hyper-param","configurations","sampled",":","param","look_back",":","the","length","to","look","back",",","either","a","tuple","with","2","int","values",",","which","is","in","format","is","(","min","len",",","max","len",")",",","or","a","single","int",",","which","is","a","fixed","length","to","look","back",".",":","param","reward_metric",":","the","rewarding","metric","value",",","when","reached",",","stop","trial",":","param","training_iteration",":","no",".","of","iterations","for","training","(","n","epochs",")","in","trials",":","param","epochs",":","no",".","of","epochs","to","train","in","each","iteration"]
code: def __init__(
      self,
      num_samples=1,
      look_back=2,
      epochs=5,
      reward_metric=-0.05,
      training_iteration=5,
  ):
      """
      __init__()
      Constructor.
  
      :param num_samples: number of hyper-param configurations sampled
      :param look_back: the length to look back, either a tuple with 2 int values,
        which is in format is (min len, max len), or a single int, which is
        a fixed length to look back.
      :param reward_metric: the rewarding metric value, when reached, stop trial
      :param training_iteration: no. of iterations for training (n epochs) in trials
      :param epochs: no. of epochs to train in each iteration
      """
      super(self.__class__, self).__init__()
      from bigdl.nano.utils.common import invalidInputError
  
      self.num_samples = num_samples
      self.reward_metric = reward_metric
      self.training_iteration = training_iteration
      self.epochs = epochs
      if (
          isinstance(look_back, tuple)
          and len(look_back) == 2
          and isinstance(look_back[0], int)
          and isinstance(look_back[1], int)
      ):
          if look_back[1] < 2:
              invalidInputError(
                  False, "The max look back value should be at least 2"
              )
          if look_back[0] < 2:
              print(
                  "The input min look back value is smaller than 2. "
                  "We sample from range (2, {}) instead.".format(
                      look_back[1]
                  )
              )
          self.bayes_past_seq_config = {
              "past_seq_len_float": hp.uniform(
                  look_back[0], look_back[1]
              )
          }
      elif isinstance(look_back, int):
          if look_back < 2:
              invalidInputError(
                  False,
                  "look back value should not be smaller than 2. "
                  "Current value is ",
                  look_back,
              )
          self.bayes_past_seq_config = {"past_seq_len": look_back}
      else:
          invalidInputError(
              False,
              "look back is {}.\n "
              "look_back should be either a tuple with 2 int values:"
              " (min_len, max_len) or a single int".format(look_back),
          )
  
imports: from bigdl.chronos.autots.deprecated.config.base import Recipe
  from bigdl.orca.automl import hp
  from bigdl.chronos.utils import deprecated
label_desc: Use image node_id 1 to create a new BayesRecipe object from inherited base classes: Recipe with example: obj = BayesRecipe(num_samples, look_back, epochs, reward_metric, training_iteration)