class_docstr: StackingForecaster.
  
  Stacks two or more Forecasters and uses a meta-model (regressor) to infer
  the final predictions from the predictions of the given forecasters.
  
  Parameters
  ----------
  forecasters : list of (str, estimator) tuples
      Estimators to apply to the input series.
  regressor: sklearn-like regressor, optional, default=None.
      The regressor is used as a meta-model and trained with the predictions
      of the ensemble forecasters as exog data and with y as endog data. The
      length of the data is dependent to the given fh. If None, then
      a GradientBoostingRegressor(max_depth=5) is used.
      The regressor can also be a sklearn.Pipeline().
  random_state : int, RandomState instance or None, default=None
      Used to set random_state of the default regressor.
  n_jobs : int or None, optional (default=None)
      The number of jobs to run in parallel for fit. None means 1 unless
      in a joblib.parallel_backend context.
      -1 means using all processors.
  
  Attributes
  ----------
  regressor_ : sklearn-like regressor
      Fitted meta-model (regressor)
  
  Examples
  --------
  >>> from sktime.forecasting.compose import StackingForecaster
  >>> from sktime.forecasting.naive import NaiveForecaster
  >>> from sktime.forecasting.trend import PolynomialTrendForecaster
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> forecasters = [
  ...     ("trend", PolynomialTrendForecaster()),
  ...     ("naive", NaiveForecaster()),
  ... ]
  >>> forecaster = StackingForecaster(forecasters=forecasters)
  >>> forecaster.fit(y=y, fh=[1,2,3])
  StackingForecaster(...)
  >>> y_pred = forecaster.predict()
class_docstr_tok: ["StackingForecaster",".","Stacks","two","or","more","Forecasters","and","uses","a","meta-model","(","regressor",")","to","infer","the","final","predictions","from","the","predictions","of","the","given","forecasters",".","Parameters","--","--","--","--","--","forecasters",":","list","of","(","str",",","estimator",")","tuples","Estimators","to","apply","to","the","input","series",".","regressor",":","sklearn-like","regressor",",","optional",",","default=None",".","The","regressor","is","used","as","a","meta-model","and","trained","with","the","predictions","of","the","ensemble","forecasters","as","exog","data","and","with","y","as","endog","data",".","The","length","of","the","data","is","dependent","to","the","given","fh",".","If","None",",","then","a","GradientBoostingRegressor","(","max_depth=5",")","is","used",".","The","regressor","can","also","be","a","sklearn.Pipeline","(",")",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Used","to","set","random_state","of","the","default","regressor",".","n_jobs",":","int","or","None",",","optional","(","default=None",")","The","number","of","jobs","to","run","in","parallel","for","fit",".","None","means","1","unless","in","a","joblib.parallel_backend","context",".","-1","means","using","all","processors",".","Attributes","--","--","--","--","--","regressor_",":","sklearn-like","regressor","Fitted","meta-model","(","regressor",")","Examples","--","--","--","--",">",">",">","from","sktime.forecasting.compose","import","StackingForecaster",">",">",">","from","sktime.forecasting.naive","import","NaiveForecaster",">",">",">","from","sktime.forecasting.trend","import","PolynomialTrendForecaster",">",">",">","from","sktime.datasets","import","load_airline",">",">",">","y","=","load_airline","(",")",">",">",">","forecasters","=","[","...","(","``","trend","''",",","PolynomialTrendForecaster","(",")",")",",","...","(","``","naive","''",",","NaiveForecaster","(",")",")",",","...","]",">",">",">","forecaster","=","StackingForecaster","(","forecasters=forecasters",")",">",">",">","forecaster.fit","(","y=y",",","fh=","[","1,2,3","]",")","StackingForecaster","(","...",")",">",">",">","y_pred","=","forecaster.predict","(",")"]
code: def __init__(
      self, forecasters, regressor=None, random_state=None, n_jobs=None
  ):
      super().__init__(forecasters=forecasters, n_jobs=n_jobs)
      self.regressor = regressor
      self.random_state = random_state
  
      self._anytagis_then_set(
          "ignores-exogeneous-X", False, True, forecasters
      )
      self._anytagis_then_set(
          "handles-missing-data", False, True, forecasters
      )
      self._anytagis_then_set("fit_is_empty", False, True, forecasters)
  
file_path: sktime/sktime/forecasting/compose/_stack.py
imports: import numpy
  import pandas
  from sktime.forecasting.base._meta import _HeterogenousEnsembleForecaster
  from sktime.split import SingleWindowSplitter
  from sktime.utils.validation.forecasting import check_regressor
  from sktime.utils.warnings import warn
label_desc: Use image node_id 1 to create a new StackingForecaster object from inherited base classes: _HeterogenousEnsembleForecaster with example: obj = StackingForecaster(forecasters, regressor, random_state, n_jobs)