class_docstr: Grid + Random Recipe for XGBoost Regressor.
docstr: Constructor. For XGBoost hyper parameters, refer to
  https://xgboost.readthedocs.io/en/latest/python/python_api.html for
  details.
  
  :param num_rand_samples: number of hyper-param configurations sampled
    randomly
  :param n_estimators: number of gradient boosted trees.
  :param max_depth: max tree depth
  :param n_jobs: number of parallel threads used to run xgboost.
  :param tree_method: specify which tree method to use.
  :param random_state: random number seed.
  :param seed: seed used to generate the folds
  :param lr: learning rate
  :param subsample: subsample ratio of the training instance
  :param colsample_bytree: subsample ratio of columns when constructing
    each tree.
  :param min_child_weight: minimum sum of instance weight(hessian)
    needed in a child.
  :param gamma: minimum loss reduction required to make a further
    partition on a leaf node of the tree.
  :param reg_alpha: L1 regularization term on weights (xgb’s alpha).
  :param reg_lambda: L2 regularization term on weights (xgb’s lambda).
docstr_tok: ["Constructor",".","For","XGBoost","hyper","parameters",",","refer","to","https",":","\/\/xgboost.readthedocs.io\/en\/latest\/python\/python_api.html","for","details",".",":","param","num_rand_samples",":","number","of","hyper-param","configurations","sampled","randomly",":","param","n_estimators",":","number","of","gradient","boosted","trees",".",":","param","max_depth",":","max","tree","depth",":","param","n_jobs",":","number","of","parallel","threads","used","to","run","xgboost",".",":","param","tree_method",":","specify","which","tree","method","to","use",".",":","param","random_state",":","random","number","seed",".",":","param","seed",":","seed","used","to","generate","the","folds",":","param","lr",":","learning","rate",":","param","subsample",":","subsample","ratio","of","the","training","instance",":","param","colsample_bytree",":","subsample","ratio","of","columns","when","constructing","each","tree",".",":","param","min_child_weight",":","minimum","sum","of","instance","weight","(","hessian",")","needed","in","a","child",".",":","param","gamma",":","minimum","loss","reduction","required","to","make","a","further","partition","on","a","leaf","node","of","the","tree",".",":","param","reg_alpha",":","L1","regularization","term","on","weights","(","xgb","\u2019","s","alpha",")",".",":","param","reg_lambda",":","L2","regularization","term","on","weights","(","xgb","\u2019","s","lambda",")","."]
code: def __init__(
      self,
      num_rand_samples=1,
      n_estimators=[8, 15],
      max_depth=[10, 15],
      n_jobs=-1,
      tree_method="hist",
      random_state=2,
      seed=0,
      lr=(1e-4, 1e-1),
      subsample=0.8,
      colsample_bytree=0.8,
      min_child_weight=[1, 2, 3],
      gamma=0,
      reg_alpha=0,
      reg_lambda=1,
  ):
      """
      Constructor. For XGBoost hyper parameters, refer to
      https://xgboost.readthedocs.io/en/latest/python/python_api.html for
      details.
  
      :param num_rand_samples: number of hyper-param configurations sampled
        randomly
      :param n_estimators: number of gradient boosted trees.
      :param max_depth: max tree depth
      :param n_jobs: number of parallel threads used to run xgboost.
      :param tree_method: specify which tree method to use.
      :param random_state: random number seed.
      :param seed: seed used to generate the folds
      :param lr: learning rate
      :param subsample: subsample ratio of the training instance
      :param colsample_bytree: subsample ratio of columns when constructing
        each tree.
      :param min_child_weight: minimum sum of instance weight(hessian)
        needed in a child.
      :param gamma: minimum loss reduction required to make a further
        partition on a leaf node of the tree.
      :param reg_alpha: L1 regularization term on weights (xgb’s alpha).
      :param reg_lambda: L2 regularization term on weights (xgb’s lambda).
  
      """
      super(self.__class__, self).__init__()
  
      self.num_samples = num_rand_samples
      self.n_jobs = n_jobs
      self.tree_method = tree_method
      self.random_state = random_state
      self.seed = seed
  
      self.colsample_bytree = colsample_bytree
      self.gamma = gamma
      self.reg_alpha = reg_alpha
      self.reg_lambda = reg_lambda
  
      self.n_estimators = hp.grid_search(n_estimators)
      self.max_depth = hp.grid_search(max_depth)
      self.lr = hp.loguniform(lr[0], lr[-1])
      self.subsample = subsample
      self.min_child_weight = hp.choice(min_child_weight)
  
imports: from zoo.chronos.autots.deprecated.config.base import Recipe
  from zoo.orca.automl import hp
  from zoo.chronos.utils import deprecated
label_desc: Use image node_id 1 to create a new XgbRegressorGridRandomRecipe object from inherited base classes: Recipe with example: obj = XgbRegressorGridRandomRecipe(num_rand_samples, n_estimators, max_depth, n_jobs, tree_method, random_state, seed, lr, subsample, colsample_bytree, min_child_weight, gamma, reg_alpha, reg_lambda)