class_docstr: Base forecaster template class.
  
  The base forecaster specifies the methods and method signatures that all forecasters
  have to implement.
  
  Specific implementations of these methods is deferred to concrete forecasters.
class_docstr_tok: ["Base","forecaster","template","class",".","The","base","forecaster","specifies","the","methods","and","method","signatures","that","all","forecasters","have","to","implement",".","Specific","implementations","of","these","methods","is","deferred","to","concrete","forecasters","."]
docstr: Forecast time series at future horizon.
  
  State required:
      Requires state to be "fitted".
  
  Accesses in self:
      Fitted model attributes ending in "_".
      self.cutoff, self._is_fitted
  
  Writes to self:
      Stores fh to self.fh if fh is passed and has not been passed previously.
  
  Parameters
  ----------
  fh : int, list, np.array or ForecastingHorizon, optional (default=None)
      The forecasting horizon encoding the time stamps to forecast at.
      if has not been passed in fit, must be passed, not optional
  X : time series in sktime compatible format, optional (default=None)
          Exogeneous time series to fit to
      Should be of same scitype (Series, Panel, or Hierarchical) as y in fit
      if self.get_tag("X-y-must-have-same-index"), X.index must contain fh.index
      there are no restrictions on number of columns (unlike for y)
  
  Returns
  -------
  y_pred : time series in sktime compatible data container format
      Point forecasts at fh, with same index as fh
      y_pred has same type as the y that has been passed most recently:
          Series, Panel, Hierarchical scitype, same format (see above)
docstr_tok: ["Forecast","time","series","at","future","horizon",".","State","required",":","Requires","state","to","be","``","fitted","''",".","Accesses","in","self",":","Fitted","model","attributes","ending","in","``","_","''",".","self.cutoff",",","self._is_fitted","Writes","to","self",":","Stores","fh","to","self.fh","if","fh","is","passed","and","has","not","been","passed","previously",".","Parameters","--","--","--","--","--","fh",":","int",",","list",",","np.array","or","ForecastingHorizon",",","optional","(","default=None",")","The","forecasting","horizon","encoding","the","time","stamps","to","forecast","at",".","if","has","not","been","passed","in","fit",",","must","be","passed",",","not","optional","X",":","time","series","in","sktime","compatible","format",",","optional","(","default=None",")","Exogeneous","time","series","to","fit","to","Should","be","of","same","scitype","(","Series",",","Panel",",","or","Hierarchical",")","as","y","in","fit","if","self.get_tag","(","``","X-y-must-have-same-index","''",")",",","X.index","must","contain","fh.index","there","are","no","restrictions","on","number","of","columns","(","unlike","for","y",")","Returns","--","--","--","-","y_pred",":","time","series","in","sktime","compatible","data","container","format","Point","forecasts","at","fh",",","with","same","index","as","fh","y_pred","has","same","type","as","the","y","that","has","been","passed","most","recently",":","Series",",","Panel",",","Hierarchical","scitype",",","same","format","(","see","above",")"]
code: def predict(self, fh=None, X=None):
      """Forecast time series at future horizon.
  
      State required:
          Requires state to be "fitted".
  
      Accesses in self:
          Fitted model attributes ending in "_".
          self.cutoff, self._is_fitted
  
      Writes to self:
          Stores fh to self.fh if fh is passed and has not been passed previously.
  
      Parameters
      ----------
      fh : int, list, np.array or ForecastingHorizon, optional (default=None)
          The forecasting horizon encoding the time stamps to forecast at.
          if has not been passed in fit, must be passed, not optional
      X : time series in sktime compatible format, optional (default=None)
              Exogeneous time series to fit to
          Should be of same scitype (Series, Panel, or Hierarchical) as y in fit
          if self.get_tag("X-y-must-have-same-index"), X.index must contain fh.index
          there are no restrictions on number of columns (unlike for y)
  
      Returns
      -------
      y_pred : time series in sktime compatible data container format
          Point forecasts at fh, with same index as fh
          y_pred has same type as the y that has been passed most recently:
              Series, Panel, Hierarchical scitype, same format (see above)
      """
      # handle inputs
  
      self.check_is_fitted()
      fh = self._check_fh(fh)
  
      # input check and conversion for X
      X_inner = self._check_X(X=X)
  
      # we call the ordinary _predict if no looping/vectorization needed
      if not self._is_vectorized:
          y_pred = self._predict(fh=fh, X=X_inner)
      else:
          # otherwise we call the vectorized version of predict
          y_pred = self._vectorize("predict", X=X_inner, fh=fh)
  
      # convert to output mtype, identical with last y mtype seen
      y_out = convert_to(
          y_pred,
          self._y_metadata["mtype"],
          store=self._converter_store_y,
          store_behaviour="freeze",
      )
  
      return y_out
  
imports: from copy import deepcopy
  from itertools import product
  import numpy
  import pandas
  from sktime.base import BaseEstimator
  from sktime.datatypes import VectorizedDF, check_is_scitype, convert_to, get_cutoff, mtype_to_scitype, scitype_to_mtype, update_data
  from sktime.forecasting.base._fh import ForecastingHorizon
  from sktime.utils.datetime import _shift
  from sktime.utils.validation._dependencies import _check_estimator_deps
  from sktime.utils.validation.forecasting import check_alpha, check_cv, check_fh, check_X
  from sktime.utils.validation.series import check_equal_time_index
  from sktime.utils.warnings import warn
label_desc: Use image node_id 8 for calling the BaseForecaster obj's underlying member method code with example usage: obj.predict(fh, X) and returns: y_out