class_docstr: Wrapper for ``pmdarima.arima.AutoARIMA``.
  It currently does not handle the regressor issue when there is
  gap between train and predict periods.
  
  Parameters
  ----------
  score_func : callable
      see ``BaseForecastEstimator``.
  coverage : float between [0.0, 1.0]
      see ``BaseForecastEstimator``.
  null_model_params : dict with arguments to define DummyRegressor null model, optional, default=None
      see ``BaseForecastEstimator``.
  regressor_cols: `list` [`str`], optional, default None
      A list of regressor columns used during training and prediction.
      If None, no regressor columns are used.
  
  See ``AutoArima`` documentation for rest of the parameter descriptions:
  
          * https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.arima.AutoARIMA.html#pmdarima.arima.AutoARIMA
  
  Attributes
  ----------
  model : ``AutoArima`` object
      Auto arima model object
  fit_df : `pandas.DataFrame` or None
      The training data used to fit the model.
  forecast : `pandas.DataFrame`
      Output of the predict method of ``AutoArima``.
class_docstr_tok: ["Wrapper","for","``","pmdarima.arima.AutoARIMA","``",".","It","currently","does","not","handle","the","regressor","issue","when","there","is","gap","between","train","and","predict","periods",".","Parameters","--","--","--","--","--","score_func",":","callable","see","``","BaseForecastEstimator","``",".","coverage",":","float","between","[","0.0",",","1.0","]","see","``","BaseForecastEstimator","``",".","null_model_params",":","dict","with","arguments","to","define","DummyRegressor","null","model",",","optional",",","default=None","see","``","BaseForecastEstimator","``",".","regressor_cols",":","`","list","`","[","`","str","`","]",",","optional",",","default","None","A","list","of","regressor","columns","used","during","training","and","prediction",".","If","None",",","no","regressor","columns","are","used",".","See","``","AutoArima","``","documentation","for","rest","of","the","parameter","descriptions",":","*","https",":","\/\/alkaline-ml.com\/pmdarima\/modules\/generated\/pmdarima.arima.AutoARIMA.html","#","pmdarima.arima.AutoARIMA","Attributes","--","--","--","--","--","model",":","``","AutoArima","``","object","Auto","arima","model","object","fit_df",":","`","pandas.DataFrame","`","or","None","The","training","data","used","to","fit","the","model",".","forecast",":","`","pandas.DataFrame","`","Output","of","the","predict","method","of","``","AutoArima","``","."]
docstr: Creates forecast for the dates specified in ``X``.
  Currently does not support the regressor case where there is gap between
  train and predict periods.
  
  Parameters
  ----------
  X: `pandas.DataFrame`
      Input timeseries with timestamp column and any additional regressors.
      Timestamps are the dates for prediction.
      Value column, if provided in ``X``, is ignored.
  y: ignored.
  
  Returns
  -------
  predictions: `pandas.DataFrame`
      Forecasted values for the dates in ``X``. Columns:
  
          - ``TIME_COL``: dates
          - ``PREDICTED_COL``: predictions
          - ``PREDICTED_LOWER_COL``: lower bound of predictions
          - ``PREDICTED_UPPER_COL``: upper bound of predictions
docstr_tok: ["Creates","forecast","for","the","dates","specified","in","``","X","``",".","Currently","does","not","support","the","regressor","case","where","there","is","gap","between","train","and","predict","periods",".","Parameters","--","--","--","--","--","X",":","`","pandas.DataFrame","`","Input","timeseries","with","timestamp","column","and","any","additional","regressors",".","Timestamps","are","the","dates","for","prediction",".","Value","column",",","if","provided","in","``","X","``",",","is","ignored",".","y",":","ignored",".","Returns","--","--","--","-","predictions",":","`","pandas.DataFrame","`","Forecasted","values","for","the","dates","in","``","X","``",".","Columns",":","-","``","TIME_COL","``",":","dates","-","``","PREDICTED_COL","``",":","predictions","-","``","PREDICTED_LOWER_COL","``",":","lower","bound","of","predictions","-","``","PREDICTED_UPPER_COL","``",":","upper","bound","of","predictions"]
code: def predict(self, X, y=None):
      """Creates forecast for the dates specified in ``X``.
      Currently does not support the regressor case where there is gap between
      train and predict periods.
  
      Parameters
      ----------
      X: `pandas.DataFrame`
          Input timeseries with timestamp column and any additional regressors.
          Timestamps are the dates for prediction.
          Value column, if provided in ``X``, is ignored.
      y: ignored.
  
      Returns
      -------
      predictions: `pandas.DataFrame`
          Forecasted values for the dates in ``X``. Columns:
  
              - ``TIME_COL``: dates
              - ``PREDICTED_COL``: predictions
              - ``PREDICTED_LOWER_COL``: lower bound of predictions
              - ``PREDICTED_UPPER_COL``: upper bound of predictions
      """
      X = X.sort_values(by=self.time_col_)
      # Returns the cached result if applicable
      cached_predictions = super().predict(X=X)
      if cached_predictions is not None:
          return cached_predictions
  
      # Currently does not support the regressor case where
      # there is gap between train and predict periods
      if self.regressor_cols is None:
          fut_reg_df = None
      else:
          fut_df = X[
              X[self.time_col_] > self.fit_df[self.time_col_].iloc[-1]
          ]
          fut_reg_df = fut_df[
              self.regressor_cols
          ]  # Auto-arima only accepts regressor values beyond `fit_df`
  
      if self.freq is None:
          self.freq = infer_freq(self.fit_df, self.time_col_)
      if self.freq == "MS":
          timedelta_freq = "M"  # `to_period` does not recognize non-traditional frequencies
      else:
          timedelta_freq = self.freq
      chosen_d = self.model.model_.order[
          1
      ]  # This is the value of the d chosen by auto-arima
      forecast_start = (
          X[self.time_col_].iloc[0].to_period(timedelta_freq)
          - self.fit_df[self.time_col_]
          .iloc[0]
          .to_period(timedelta_freq)
      ).n
      if forecast_start < chosen_d:
          append_length = (
              chosen_d - forecast_start
          )  # Number of NaNs to append to `pred_df`
          forecast_start = (
              chosen_d  # Auto-arima can not predict below the chosen d
          )
      else:
          append_length = 0
      forecast_end = (
          X[self.time_col_].iloc[-1].to_period(timedelta_freq)
          - self.fit_df[self.time_col_]
          .iloc[0]
          .to_period(timedelta_freq)
      ).n
  
      predictions = self.model.predict_in_sample(
          X=fut_reg_df,
          start=forecast_start,
          end=forecast_end,
          dynamic=self.dynamic,
          return_conf_int=self.return_conf_int,
          alpha=(1 - self.coverage),
      )
  
      if append_length > 0:
          pred_df = pd.DataFrame(
              {
                  TIME_COL: X[self.time_col_],
                  PREDICTED_COL: np.append(
                      np.repeat(np.nan, append_length), predictions[0]
                  ),
                  PREDICTED_LOWER_COL: np.append(
                      np.repeat(np.nan, append_length),
                      predictions[1][:, 0],
                  ),
                  PREDICTED_UPPER_COL: np.append(
                      np.repeat(np.nan, append_length),
                      predictions[1][:, 1],
                  ),
              }
          )
      else:
          pred_df = pd.DataFrame(
              {
                  TIME_COL: X[self.time_col_],
                  PREDICTED_COL: predictions[0],
                  PREDICTED_LOWER_COL: predictions[1][:, 0],
                  PREDICTED_UPPER_COL: predictions[1][:, 1],
              }
          )
      self.forecast = pred_df
  
      # Caches the predictions
      self.cached_predictions_ = pred_df
  
      return pred_df
  
imports: from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Union
  import numpy
  import pandas
  from pmdarima.arima import AutoARIMA
  from sklearn.metrics import mean_squared_error
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.time_properties import infer_freq
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
label_desc: Use image node_id 3 for calling the AutoArimaEstimator obj's underlying member method code with example usage: obj.predict(X, y) and returns: pred_df, cached_predictions