class_docstr: Base class for interfacing statsmodels forecasting algorithms.
class_docstr_tok: ["Base","class","for","interfacing","statsmodels","forecasting","algorithms","."]
docstr: Make forecasts.
  
  Parameters
  ----------
  fh : ForecastingHorizon
      The forecasters horizon with the steps ahead to to predict.
      Default is one-step ahead forecast,
      i.e. np.array([1])
  X : pd.DataFrame, optional (default=None)
      Exogenous variables are ignored.
  
  Returns
  -------
  y_pred : pd.Series
      Returns series of predicted values.
docstr_tok: ["Make","forecasts",".","Parameters","--","--","--","--","--","fh",":","ForecastingHorizon","The","forecasters","horizon","with","the","steps","ahead","to","to","predict",".","Default","is","one-step","ahead","forecast",",","i.e",".","np.array","(","[","1","]",")","X",":","pd.DataFrame",",","optional","(","default=None",")","Exogenous","variables","are","ignored",".","Returns","--","--","--","-","y_pred",":","pd.Series","Returns","series","of","predicted","values","."]
code: def _predict(self, fh, X):
      """Make forecasts.
  
      Parameters
      ----------
      fh : ForecastingHorizon
          The forecasters horizon with the steps ahead to to predict.
          Default is one-step ahead forecast,
          i.e. np.array([1])
      X : pd.DataFrame, optional (default=None)
          Exogenous variables are ignored.
  
      Returns
      -------
      y_pred : pd.Series
          Returns series of predicted values.
      """
      # statsmodels requires zero-based indexing starting at the
      # beginning of the training series when passing integers
      start, end = fh.to_absolute_int(self._y.index[0], self.cutoff)[
          [0, -1]
      ]
      fh_int = fh.to_absolute_int(self._y.index[0], self.cutoff) - len(
          self._y
      )
  
      # bug fix for evaluate function as test_plus_train indices are passed
      # statsmodels exog must contain test indices only.
      # For discussion see https://github.com/sktime/sktime/issues/3830
      if X is not None:
          ind_drop = self._X.index
          X = X.loc[~X.index.isin(ind_drop)]
          # Entire range of the forecast horizon is required
          X = X.iloc[: (fh_int[-1] + 1)]  # include end point
  
      if (
          "exog"
          in inspect.signature(
              self._forecaster.__init__
          ).parameters.keys()
      ):
          y_pred = self._fitted_forecaster.predict(
              start=start, end=end, exog=X
          )
      else:
          y_pred = self._fitted_forecaster.predict(start=start, end=end)
  
      # statsmodels forecasts all periods from start to end of forecasting
      # horizon, but only return given time points in forecasting horizon
      # if fh[0] > 1 steps ahead of cutoff then make relative to `start`
      fh_int = fh_int - fh_int[0]
      y_pred = y_pred.iloc[fh_int]
      # ensure that name is not added nor removed
      # otherwise this may upset conversion to pd.DataFrame
      y_pred.name = self._y.name
      return y_pred
  
file_path: sktime/sktime/forecasting/base/adapters/_statsmodels.py
imports: import inspect
  import numpy
  import pandas
  from sktime.forecasting.base import BaseForecaster
  from sktime.utils.warnings import warn
label_desc: Use image node_id 5 for calling the _StatsModelsAdapter obj's underlying member method code with example usage: obj._predict(fh, X) and returns: y_pred