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: Update model with new data and make forecasts.
  
  This method is useful for updating and making forecasts in a single step.
  
  If no estimator-specific update method has been implemented,
  default fall-back is first update, then predict.
  
  State required:
      Requires state to be "fitted".
  
  Accesses in self:
      Fitted model attributes ending in "_".
      Pointers to seen data, self._y and self.X
      self.cutoff, self._is_fitted
      If update_params=True, model attributes ending in "_".
  
  Writes to self:
      Update self._y and self._X with `y` and `X`, by appending rows.
      Updates self.cutoff and self._cutoff to last index seen in `y`.
      If update_params=True,
          updates fitted model attributes ending in "_".
  
  Parameters
  ----------
  y : time series in sktime compatible data container format
          Time series to which to fit the forecaster in the update.
      y can be in one of the following formats, must be same scitype as in fit:
      Series scitype: pd.Series, pd.DataFrame, or np.ndarray (1D or 2D)
          for vanilla forecasting, one time series
      Panel scitype: pd.DataFrame with 2-level row MultiIndex,
          3D np.ndarray, list of Series pd.DataFrame, or nested pd.DataFrame
          for global or panel forecasting
      Hierarchical scitype: pd.DataFrame with 3 or more level row MultiIndex
          for hierarchical forecasting
      Number of columns admissible depend on the "scitype:y" tag:
          if self.get_tag("scitype:y")=="univariate":
              y must have a single column/variable
          if self.get_tag("scitype:y")=="multivariate":
              y must have 2 or more columns
          if self.get_tag("scitype:y")=="both": no restrictions on columns apply
      For further details:
          on usage, see forecasting tutorial examples/01_forecasting.ipynb
          on specification of formats, examples/AA_datatypes_and_datasets.ipynb
  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 for updating and forecasting
      Should be of same scitype (Series, Panel, or Hierarchical) as y
      if self.get_tag("X-y-must-have-same-index"),
          X.index must contain y.index and fh.index both
  update_params : bool, optional (default=False)
  
  Returns
  -------
  y_pred : time series in sktime compatible data container format
      Point forecasts at fh, with same index as fh
      if fh was relative, index is relative to cutoff after update with y
      y_pred has same type as the y that has been passed most recently:
          Series, Panel, Hierarchical scitype, same format (see above)
docstr_tok: ["Update","model","with","new","data","and","make","forecasts",".","This","method","is","useful","for","updating","and","making","forecasts","in","a","single","step",".","If","no","estimator-specific","update","method","has","been","implemented",",","default","fall-back","is","first","update",",","then","predict",".","State","required",":","Requires","state","to","be","``","fitted","''",".","Accesses","in","self",":","Fitted","model","attributes","ending","in","``","_","''",".","Pointers","to","seen","data",",","self._y","and","self.X","self.cutoff",",","self._is_fitted","If","update_params=True",",","model","attributes","ending","in","``","_","''",".","Writes","to","self",":","Update","self._y","and","self._X","with","`","y","`","and","`","X","`",",","by","appending","rows",".","Updates","self.cutoff","and","self._cutoff","to","last","index","seen","in","`","y","`",".","If","update_params=True",",","updates","fitted","model","attributes","ending","in","``","_","''",".","Parameters","--","--","--","--","--","y",":","time","series","in","sktime","compatible","data","container","format","Time","series","to","which","to","fit","the","forecaster","in","the","update",".","y","can","be","in","one","of","the","following","formats",",","must","be","same","scitype","as","in","fit",":","Series","scitype",":","pd.Series",",","pd.DataFrame",",","or","np.ndarray","(","1D","or","2D",")","for","vanilla","forecasting",",","one","time","series","Panel","scitype",":","pd.DataFrame","with","2-level","row","MultiIndex",",","3D","np.ndarray",",","list","of","Series","pd.DataFrame",",","or","nested","pd.DataFrame","for","global","or","panel","forecasting","Hierarchical","scitype",":","pd.DataFrame","with","3","or","more","level","row","MultiIndex","for","hierarchical","forecasting","Number","of","columns","admissible","depend","on","the","``","scitype",":","y","''","tag",":","if","self.get_tag","(","``","scitype",":","y","''",")","==","''","univariate","''",":","y","must","have","a","single","column\/variable","if","self.get_tag","(","``","scitype",":","y","''",")","==","''","multivariate","''",":","y","must","have","2","or","more","columns","if","self.get_tag","(","``","scitype",":","y","''",")","==","''","both","''",":","no","restrictions","on","columns","apply","For","further","details",":","on","usage",",","see","forecasting","tutorial","examples\/01_forecasting.ipynb","on","specification","of","formats",",","examples\/AA_datatypes_and_datasets.ipynb","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","for","updating","and","forecasting","Should","be","of","same","scitype","(","Series",",","Panel",",","or","Hierarchical",")","as","y","if","self.get_tag","(","``","X-y-must-have-same-index","''",")",",","X.index","must","contain","y.index","and","fh.index","both","update_params",":","bool",",","optional","(","default=False",")","Returns","--","--","--","-","y_pred",":","time","series","in","sktime","compatible","data","container","format","Point","forecasts","at","fh",",","with","same","index","as","fh","if","fh","was","relative",",","index","is","relative","to","cutoff","after","update","with","y","y_pred","has","same","type","as","the","y","that","has","been","passed","most","recently",":","Series",",","Panel",",","Hierarchical","scitype",",","same","format","(","see","above",")"]
code: def update_predict_single(
      self,
      y=None,
      fh=None,
      X=None,
      update_params=True,
  ):
      """Update model with new data and make forecasts.
  
      This method is useful for updating and making forecasts in a single step.
  
      If no estimator-specific update method has been implemented,
      default fall-back is first update, then predict.
  
      State required:
          Requires state to be "fitted".
  
      Accesses in self:
          Fitted model attributes ending in "_".
          Pointers to seen data, self._y and self.X
          self.cutoff, self._is_fitted
          If update_params=True, model attributes ending in "_".
  
      Writes to self:
          Update self._y and self._X with `y` and `X`, by appending rows.
          Updates self.cutoff and self._cutoff to last index seen in `y`.
          If update_params=True,
              updates fitted model attributes ending in "_".
  
      Parameters
      ----------
      y : time series in sktime compatible data container format
              Time series to which to fit the forecaster in the update.
          y can be in one of the following formats, must be same scitype as in fit:
          Series scitype: pd.Series, pd.DataFrame, or np.ndarray (1D or 2D)
              for vanilla forecasting, one time series
          Panel scitype: pd.DataFrame with 2-level row MultiIndex,
              3D np.ndarray, list of Series pd.DataFrame, or nested pd.DataFrame
              for global or panel forecasting
          Hierarchical scitype: pd.DataFrame with 3 or more level row MultiIndex
              for hierarchical forecasting
          Number of columns admissible depend on the "scitype:y" tag:
              if self.get_tag("scitype:y")=="univariate":
                  y must have a single column/variable
              if self.get_tag("scitype:y")=="multivariate":
                  y must have 2 or more columns
              if self.get_tag("scitype:y")=="both": no restrictions on columns apply
          For further details:
              on usage, see forecasting tutorial examples/01_forecasting.ipynb
              on specification of formats, examples/AA_datatypes_and_datasets.ipynb
      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 for updating and forecasting
          Should be of same scitype (Series, Panel, or Hierarchical) as y
          if self.get_tag("X-y-must-have-same-index"),
              X.index must contain y.index and fh.index both
      update_params : bool, optional (default=False)
  
      Returns
      -------
      y_pred : time series in sktime compatible data container format
          Point forecasts at fh, with same index as fh
          if fh was relative, index is relative to cutoff after update with y
          y_pred has same type as the y that has been passed most recently:
              Series, Panel, Hierarchical scitype, same format (see above)
      """
      if y is None or (hasattr(y, "__len__") and len(y) == 0):
          warn(
              f"empty y passed to update_predict of {self}, "
              "no update was carried out",
              obj=self,
          )
          return self.predict(fh=fh, X=X)
  
      self.check_is_fitted()
      fh = self._check_fh(fh)
  
      # input checks and minor coercions on X, y
      X_inner, y_inner = self._check_X_y(X=X, y=y)
  
      # update internal _X/_y with the new X/y
      # this also updates cutoff from y
      self._update_y_X(y_inner, X_inner)
  
      # checks and conversions complete, pass to inner update_predict_single
      if not self._is_vectorized:
          y_pred = self._update_predict_single(
              y=y_inner, X=X_inner, fh=fh, update_params=update_params
          )
      else:
          y_pred = self._vectorize(
              "update_predict_single",
              y=y_inner,
              X=X_inner,
              fh=fh,
              update_params=update_params,
          )
  
      # convert to output mtype, identical with last y mtype seen
      y_pred = convert_to(
          y_pred,
          self._y_metadata["mtype"],
          store=self._converter_store_y,
          store_behaviour="freeze",
      )
  
      return y_pred
  
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 16 for calling the BaseForecaster obj's underlying member method code with example usage: obj.update_predict_single(y, fh, X, update_params) and returns: y_pred, self