docstr: Create an automated ARIMA Model.
  User need to specify either the exact value or the search space of
  the ARIMA model hyperparameters. For details of the ARIMA model hyperparameters, refer to
  https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.arima.ARIMA.html#pmdarima.arima.ARIMA.
  
  :param p: Int or hp sampling function from an integer space for hyperparameter p
         of the ARIMA model.
         For hp sampling, see bigdl.chronos.orca.automl.hp for more details.
         e.g. hp.randint(0, 3).
  :param q: Int or hp sampling function from an integer space for hyperparameter q
         of the ARIMA model.
         e.g. hp.randint(0, 3).
  :param seasonal: Bool or hp sampling function from an integer space for whether to add
         seasonal components to the ARIMA model.
         e.g. hp.choice([True, False]).
  :param P: Int or hp sampling function from an integer space for hyperparameter P
         of the ARIMA model.
         For hp sampling, see bigdl.chronos.orca.automl.hp for more details.
         e.g. hp.randint(0, 3).
  :param Q: Int or hp sampling function from an integer space for hyperparameter Q
         of the ARIMA model.
         e.g. hp.randint(0, 3).
  :param m: Int or hp sampling function from an integer space for hyperparameter p
         of the ARIMA model.
         e.g. hp.choice([4, 7, 12, 24, 365]).
  :param metric: String or customized evaluation metric function.
      If string, metric is the evaluation metric name to optimize, e.g. "mse".
      If callable function, it signature should be func(y_true, y_pred), where y_true and
      y_pred are numpy ndarray. The function should return a float value as evaluation result.
  :param metric_mode: One of ["min", "max"]. "max" means greater metric value is better.
      You have to specify metric_mode if you use a customized metric function.
      You don't have to specify metric_mode if you use the built-in metric in
      bigdl.orca.automl.metrics.Evaluator.
  :param logs_dir: Local directory to save logs and results. It defaults to
         "/tmp/auto_arima_logs"
  :param cpus_per_trial: Int. Number of cpus for each trial. It defaults to 1.
  :param name: name of the AutoARIMA. It defaults to "auto_arima"
  :param remote_dir: String. Remote directory to sync training results and checkpoints. It
      defaults to None and doesn't take effects while running in local. While running in
      cluster, it defaults to "hdfs:///tmp/{name}".
  :param arima_config: Other ARIMA hyperparameters.
docstr_tok: ["Create","an","automated","ARIMA","Model",".","User","need","to","specify","either","the","exact","value","or","the","search","space","of","the","ARIMA","model","hyperparameters",".","For","details","of","the","ARIMA","model","hyperparameters",",","refer","to","https",":","\/\/alkaline-ml.com\/pmdarima\/modules\/generated\/pmdarima.arima.ARIMA.html","#","pmdarima.arima.ARIMA",".",":","param","p",":","Int","or","hp","sampling","function","from","an","integer","space","for","hyperparameter","p","of","the","ARIMA","model",".","For","hp","sampling",",","see","bigdl.chronos.orca.automl.hp","for","more","details",".","e.g",".","hp.randint","(","0",",","3",")",".",":","param","q",":","Int","or","hp","sampling","function","from","an","integer","space","for","hyperparameter","q","of","the","ARIMA","model",".","e.g",".","hp.randint","(","0",",","3",")",".",":","param","seasonal",":","Bool","or","hp","sampling","function","from","an","integer","space","for","whether","to","add","seasonal","components","to","the","ARIMA","model",".","e.g",".","hp.choice","(","[","True",",","False","]",")",".",":","param","P",":","Int","or","hp","sampling","function","from","an","integer","space","for","hyperparameter","P","of","the","ARIMA","model",".","For","hp","sampling",",","see","bigdl.chronos.orca.automl.hp","for","more","details",".","e.g",".","hp.randint","(","0",",","3",")",".",":","param","Q",":","Int","or","hp","sampling","function","from","an","integer","space","for","hyperparameter","Q","of","the","ARIMA","model",".","e.g",".","hp.randint","(","0",",","3",")",".",":","param","m",":","Int","or","hp","sampling","function","from","an","integer","space","for","hyperparameter","p","of","the","ARIMA","model",".","e.g",".","hp.choice","(","[","4",",","7",",","12",",","24",",","365","]",")",".",":","param","metric",":","String","or","customized","evaluation","metric","function",".","If","string",",","metric","is","the","evaluation","metric","name","to","optimize",",","e.g",".","``","mse","''",".","If","callable","function",",","it","signature","should","be","func","(","y_true",",","y_pred",")",",","where","y_true","and","y_pred","are","numpy","ndarray",".","The","function","should","return","a","float","value","as","evaluation","result",".",":","param","metric_mode",":","One","of","[","``","min","''",",","``","max","''","]",".","``","max","''","means","greater","metric","value","is","better",".","You","have","to","specify","metric_mode","if","you","use","a","customized","metric","function",".","You","do","n't","have","to","specify","metric_mode","if","you","use","the","built-in","metric","in","bigdl.orca.automl.metrics.Evaluator",".",":","param","logs_dir",":","Local","directory","to","save","logs","and","results",".","It","defaults","to","``","\/tmp\/auto_arima_logs","''",":","param","cpus_per_trial",":","Int",".","Number","of","cpus","for","each","trial",".","It","defaults","to","1.",":","param","name",":","name","of","the","AutoARIMA",".","It","defaults","to","``","auto_arima","''",":","param","remote_dir",":","String",".","Remote","directory","to","sync","training","results","and","checkpoints",".","It","defaults","to","None","and","does","n't","take","effects","while","running","in","local",".","While","running","in","cluster",",","it","defaults","to","``","hdfs",":","\/\/\/tmp\/","{","name","}","''",".",":","param","arima_config",":","Other","ARIMA","hyperparameters","."]
code: def __init__(
      self,
      p=2,
      q=2,
      seasonal=True,
      P=1,
      Q=1,
      m=7,
      metric="mse",
      metric_mode=None,
      logs_dir="/tmp/auto_arima_logs",
      cpus_per_trial=1,
      name="auto_arima",
      remote_dir=None,
      load_dir=None,
      **arima_config,
  ):
      """
      Create an automated ARIMA Model.
      User need to specify either the exact value or the search space of
      the ARIMA model hyperparameters. For details of the ARIMA model hyperparameters, refer to
      https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.arima.ARIMA.html#pmdarima.arima.ARIMA.
  
      :param p: Int or hp sampling function from an integer space for hyperparameter p
             of the ARIMA model.
             For hp sampling, see bigdl.chronos.orca.automl.hp for more details.
             e.g. hp.randint(0, 3).
      :param q: Int or hp sampling function from an integer space for hyperparameter q
             of the ARIMA model.
             e.g. hp.randint(0, 3).
      :param seasonal: Bool or hp sampling function from an integer space for whether to add
             seasonal components to the ARIMA model.
             e.g. hp.choice([True, False]).
      :param P: Int or hp sampling function from an integer space for hyperparameter P
             of the ARIMA model.
             For hp sampling, see bigdl.chronos.orca.automl.hp for more details.
             e.g. hp.randint(0, 3).
      :param Q: Int or hp sampling function from an integer space for hyperparameter Q
             of the ARIMA model.
             e.g. hp.randint(0, 3).
      :param m: Int or hp sampling function from an integer space for hyperparameter p
             of the ARIMA model.
             e.g. hp.choice([4, 7, 12, 24, 365]).
      :param metric: String or customized evaluation metric function.
          If string, metric is the evaluation metric name to optimize, e.g. "mse".
          If callable function, it signature should be func(y_true, y_pred), where y_true and
          y_pred are numpy ndarray. The function should return a float value as evaluation result.
      :param metric_mode: One of ["min", "max"]. "max" means greater metric value is better.
          You have to specify metric_mode if you use a customized metric function.
          You don't have to specify metric_mode if you use the built-in metric in
          bigdl.orca.automl.metrics.Evaluator.
      :param logs_dir: Local directory to save logs and results. It defaults to
             "/tmp/auto_arima_logs"
      :param cpus_per_trial: Int. Number of cpus for each trial. It defaults to 1.
      :param name: name of the AutoARIMA. It defaults to "auto_arima"
      :param remote_dir: String. Remote directory to sync training results and checkpoints. It
          defaults to None and doesn't take effects while running in local. While running in
          cluster, it defaults to "hdfs:///tmp/{name}".
      :param arima_config: Other ARIMA hyperparameters.
  
      """
      if load_dir:
          self.best_model = ARIMAModel()
          self.best_model.restore(load_dir)
      try:
          from bigdl.orca.automl.auto_estimator import AutoEstimator
  
          self.search_space = {
              "p": p,
              "q": q,
              "seasonal": seasonal,
              "P": P,
              "Q": Q,
              "m": m,
          }
          self.metric = metric
          self.metric_mode = metric_mode
          model_builder = ARIMABuilder()
          self.auto_est = AutoEstimator(
              model_builder=model_builder,
              logs_dir=logs_dir,
              resources_per_trial={"cpu": cpus_per_trial},
              remote_dir=remote_dir,
              name=name,
          )
      except ImportError:
          warnings.warn(
              "You need to install `bigdl-orca[automl]` to use `fit` function."
          )
  
imports: import warnings
  from bigdl.chronos.model.arima import ARIMABuilder, ARIMAModel
  from bigdl.chronos.autots.utils import recalculate_n_sampling
label_desc: Use image node_id 1 to create a new AutoARIMA object  with example: obj = AutoARIMA(p, q, seasonal, P, Q, m, metric, metric_mode, logs_dir, cpus_per_trial, name, remote_dir, load_dir)