class_docstr: This class turns any regressor compatible with the scikit-learn API into a
  recursive autoregressive (multi-step) forecaster.
  
  Parameters
  ----------
  regressor : regressor or pipeline compatible with the scikit-learn API
      An instance of a regressor or pipeline compatible with the scikit-learn API
  lags : int, list, numpy ndarray, range
      Lags used as predictors. Index starts at 1, so lag 1 is equal to t-1. 
  
      - `int`: include lags from 1 to `lags` (included).
      - `list`, `1d numpy ndarray` or `range`: include only lags present in 
      `lags`, all elements must be int.
  transformer_y : object transformer (preprocessor), default `None`
      An instance of a transformer (preprocessor) compatible with the scikit-learn
      preprocessing API with methods: fit, transform, fit_transform and inverse_transform.
      ColumnTransformers are not allowed since they do not have inverse_transform method.
      The transformation is applied to `y` before training the forecaster. 
  transformer_exog : object transformer (preprocessor), default `None`
      An instance of a transformer (preprocessor) compatible with the scikit-learn
      preprocessing API. The transformation is applied to `exog` before training the
      forecaster. `inverse_transform` is not available when using ColumnTransformers.
  weight_func : Callable, default `None`
      Function that defines the individual weights for each sample based on the
      index. For example, a function that assigns a lower weight to certain dates.
      Ignored if `regressor` does not have the argument `sample_weight` in its `fit`
      method. The resulting `sample_weight` cannot have negative values.
  differentiation : int, default `None`
      Order of differencing applied to the time series before training the forecaster.
      If `None`, no differencing is applied. The order of differentiation is the number
      of times the differencing operation is applied to a time series. Differencing
      involves computing the differences between consecutive data points in the series.
      Differentiation is reversed in the output of `predict()` and `predict_interval()`.
      **WARNING: This argument is newly introduced and requires special attention. It
      is still experimental and may undergo changes.**
      **New in version 0.10.0**
  fit_kwargs : dict, default `None`
      Additional arguments to be passed to the `fit` method of the regressor.
  forecaster_id : str, int, default `None`
      Name used as an identifier of the forecaster.
  
  Attributes
  ----------
  regressor : regressor or pipeline compatible with the scikit-learn API
      An instance of a regressor or pipeline compatible with the scikit-learn API.
  lags : numpy ndarray
      Lags used as predictors.
  transformer_y : object transformer (preprocessor)
      An instance of a transformer (preprocessor) compatible with the scikit-learn
      preprocessing API with methods: fit, transform, fit_transform and inverse_transform.
      ColumnTransformers are not allowed since they do not have inverse_transform method.
      The transformation is applied to `y` before training the forecaster.
  transformer_exog : object transformer (preprocessor)
      An instance of a transformer (preprocessor) compatible with the scikit-learn
      preprocessing API. The transformation is applied to `exog` before training the
      forecaster. `inverse_transform` is not available when using ColumnTransformers.
  weight_func : Callable
      Function that defines the individual weights for each sample based on the
      index. For example, a function that assigns a lower weight to certain dates.
      Ignored if `regressor` does not have the argument `sample_weight` in its `fit`
      method. The resulting `sample_weight` cannot have negative values.
  differentiation : int, default `None`
      Order of differencing applied to the time series before training the forecaster.
      If `None`, no differencing is applied. The order of differentiation is the number
      of times the differencing operation is applied to a time series. Differencing
      involves computing the differences between consecutive data points in the series.
      Differentiation is reversed in the output of `predict()` and `predict_interval()`.
      **WARNING: This argument is newly introduced and requires special attention. It
      is still experimental and may undergo changes.**
      **New in version 0.10.0**
  source_code_weight_func : str
      Source code of the custom function used to create weights.
  max_lag : int
      Maximum value of lag included in `lags`.
  window_size : int
      Size of the window needed to create the predictors. It is equal to `max_lag`.
      If `differentiation` is not `None`, the size of the window is `max_lag` +
      `differentiation`.
  last_window : pandas Series
      This window represents the most recent data observed by the predictor
      during its training phase. It contains the values needed to predict the
      next step immediately after the training data. These values are stored
      in the original scale of the time series before undergoing any transformations
      or differentiation. When `differentiation` parameter is specified, the
      dimensions of the `last_window` are expanded as many values as the order
      of differentiation. For example, if `lags` = 7 and `differentiation` = 1,
      `last_window` will have 8 values.
  index_type : type
      Type of index of the input used in training.
  index_freq : str
      Frequency of Index of the input used in training.
  training_range : pandas Index
      First and last values of index of the data used during training.
  included_exog : bool
      If the forecaster has been trained using exogenous variable/s.
  exog_type : type
      Type of exogenous data (pandas Series or DataFrame) used in training.
  exog_dtypes : dict
      Type of each exogenous variable/s used in training. If `transformer_exog` 
      is used, the dtypes are calculated after the transformation.
  exog_col_names : list
      Names of columns of `exog` if `exog` used in training was a pandas
      DataFrame.
  X_train_col_names : list
      Names of columns of the matrix created internally for training.
  fit_kwargs : dict
      Additional arguments to be passed to the `fit` method of the regressor.
  in_sample_residuals : numpy ndarray
      Residuals of the model when predicting training data. Only stored up to
      1000 values. If `transformer_y` is not `None`, residuals are stored in the
      transformed scale.
  out_sample_residuals : numpy ndarray
      Residuals of the model when predicting non training data. Only stored
      up to 1000 values. If `transformer_y` is not `None`, residuals
      are assumed to be in the transformed scale. Use `set_out_sample_residuals` 
      method to set values.
  fitted : bool
      Tag to identify if the regressor has been fitted (trained).
  creation_date : str
      Date of creation.
  fit_date : str
      Date of last fit.
  skforecast_version : str
      Version of skforecast library used to create the forecaster.
  python_version : str
      Version of python used to create the forecaster.
  forecaster_id : str, int
      Name used as an identifier of the forecaster.
class_docstr_tok: ["This","class","turns","any","regressor","compatible","with","the","scikit-learn","API","into","a","recursive","autoregressive","(","multi-step",")","forecaster",".","Parameters","--","--","--","--","--","regressor",":","regressor","or","pipeline","compatible","with","the","scikit-learn","API","An","instance","of","a","regressor","or","pipeline","compatible","with","the","scikit-learn","API","lags",":","int",",","list",",","numpy","ndarray",",","range","Lags","used","as","predictors",".","Index","starts","at","1",",","so","lag","1","is","equal","to","t-1",".","-","`","int","`",":","include","lags","from","1","to","`","lags","`","(","included",")",".","-","`","list","`",",","`","1d","numpy","ndarray","`","or","`","range","`",":","include","only","lags","present","in","`","lags","`",",","all","elements","must","be","int",".","transformer_y",":","object","transformer","(","preprocessor",")",",","default","`","None","`","An","instance","of","a","transformer","(","preprocessor",")","compatible","with","the","scikit-learn","preprocessing","API","with","methods",":","fit",",","transform",",","fit_transform","and","inverse_transform",".","ColumnTransformers","are","not","allowed","since","they","do","not","have","inverse_transform","method",".","The","transformation","is","applied","to","`","y","`","before","training","the","forecaster",".","transformer_exog",":","object","transformer","(","preprocessor",")",",","default","`","None","`","An","instance","of","a","transformer","(","preprocessor",")","compatible","with","the","scikit-learn","preprocessing","API",".","The","transformation","is","applied","to","`","exog","`","before","training","the","forecaster",".","`","inverse_transform","`","is","not","available","when","using","ColumnTransformers",".","weight_func",":","Callable",",","default","`","None","`","Function","that","defines","the","individual","weights","for","each","sample","based","on","the","index",".","For","example",",","a","function","that","assigns","a","lower","weight","to","certain","dates",".","Ignored","if","`","regressor","`","does","not","have","the","argument","`","sample_weight","`","in","its","`","fit","`","method",".","The","resulting","`","sample_weight","`","can","not","have","negative","values",".","differentiation",":","int",",","default","`","None","`","Order","of","differencing","applied","to","the","time","series","before","training","the","forecaster",".","If","`","None","`",",","no","differencing","is","applied",".","The","order","of","differentiation","is","the","number","of","times","the","differencing","operation","is","applied","to","a","time","series",".","Differencing","involves","computing","the","differences","between","consecutive","data","points","in","the","series",".","Differentiation","is","reversed","in","the","output","of","`","predict","(",")","`","and","`","predict_interval","(",")","`",".","*","*","WARNING",":","This","argument","is","newly","introduced","and","requires","special","attention",".","It","is","still","experimental","and","may","undergo","changes",".","*","*","*","*","New","in","version","0.10.0","*","*","fit_kwargs",":","dict",",","default","`","None","`","Additional","arguments","to","be","passed","to","the","`","fit","`","method","of","the","regressor",".","forecaster_id",":","str",",","int",",","default","`","None","`","Name","used","as","an","identifier","of","the","forecaster",".","Attributes","--","--","--","--","--","regressor",":","regressor","or","pipeline","compatible","with","the","scikit-learn","API","An","instance","of","a","regressor","or","pipeline","compatible","with","the","scikit-learn","API",".","lags",":","numpy","ndarray","Lags","used","as","predictors",".","transformer_y",":","object","transformer","(","preprocessor",")","An","instance","of","a","transformer","(","preprocessor",")","compatible","with","the","scikit-learn","preprocessing","API","with","methods",":","fit",",","transform",",","fit_transform","and","inverse_transform",".","ColumnTransformers","are","not","allowed","since","they","do","not","have","inverse_transform","method",".","The","transformation","is","applied","to","`","y","`","before","training","the","forecaster",".","transformer_exog",":","object","transformer","(","preprocessor",")","An","instance","of","a","transformer","(","preprocessor",")","compatible","with","the","scikit-learn","preprocessing","API",".","The","transformation","is","applied","to","`","exog","`","before","training","the","forecaster",".","`","inverse_transform","`","is","not","available","when","using","ColumnTransformers",".","weight_func",":","Callable","Function","that","defines","the","individual","weights","for","each","sample","based","on","the","index",".","For","example",",","a","function","that","assigns","a","lower","weight","to","certain","dates",".","Ignored","if","`","regressor","`","does","not","have","the","argument","`","sample_weight","`","in","its","`","fit","`","method",".","The","resulting","`","sample_weight","`","can","not","have","negative","values",".","differentiation",":","int",",","default","`","None","`","Order","of","differencing","applied","to","the","time","series","before","training","the","forecaster",".","If","`","None","`",",","no","differencing","is","applied",".","The","order","of","differentiation","is","the","number","of","times","the","differencing","operation","is","applied","to","a","time","series",".","Differencing","involves","computing","the","differences","between","consecutive","data","points","in","the","series",".","Differentiation","is","reversed","in","the","output","of","`","predict","(",")","`","and","`","predict_interval","(",")","`",".","*","*","WARNING",":","This","argument","is","newly","introduced","and","requires","special","attention",".","It","is","still","experimental","and","may","undergo","changes",".","*","*","*","*","New","in","version","0.10.0","*","*","source_code_weight_func",":","str","Source","code","of","the","custom","function","used","to","create","weights",".","max_lag",":","int","Maximum","value","of","lag","included","in","`","lags","`",".","window_size",":","int","Size","of","the","window","needed","to","create","the","predictors",".","It","is","equal","to","`","max_lag","`",".","If","`","differentiation","`","is","not","`","None","`",",","the","size","of","the","window","is","`","max_lag","`","+","`","differentiation","`",".","last_window",":","pandas","Series","This","window","represents","the","most","recent","data","observed","by","the","predictor","during","its","training","phase",".","It","contains","the","values","needed","to","predict","the","next","step","immediately","after","the","training","data",".","These","values","are","stored","in","the","original","scale","of","the","time","series","before","undergoing","any","transformations","or","differentiation",".","When","`","differentiation","`","parameter","is","specified",",","the","dimensions","of","the","`","last_window","`","are","expanded","as","many","values","as","the","order","of","differentiation",".","For","example",",","if","`","lags","`","=","7","and","`","differentiation","`","=","1",",","`","last_window","`","will","have","8","values",".","index_type",":","type","Type","of","index","of","the","input","used","in","training",".","index_freq",":","str","Frequency","of","Index","of","the","input","used","in","training",".","training_range",":","pandas","Index","First","and","last","values","of","index","of","the","data","used","during","training",".","included_exog",":","bool","If","the","forecaster","has","been","trained","using","exogenous","variable\/s",".","exog_type",":","type","Type","of","exogenous","data","(","pandas","Series","or","DataFrame",")","used","in","training",".","exog_dtypes",":","dict","Type","of","each","exogenous","variable\/s","used","in","training",".","If","`","transformer_exog","`","is","used",",","the","dtypes","are","calculated","after","the","transformation",".","exog_col_names",":","list","Names","of","columns","of","`","exog","`","if","`","exog","`","used","in","training","was","a","pandas","DataFrame",".","X_train_col_names",":","list","Names","of","columns","of","the","matrix","created","internally","for","training",".","fit_kwargs",":","dict","Additional","arguments","to","be","passed","to","the","`","fit","`","method","of","the","regressor",".","in_sample_residuals",":","numpy","ndarray","Residuals","of","the","model","when","predicting","training","data",".","Only","stored","up","to","1000","values",".","If","`","transformer_y","`","is","not","`","None","`",",","residuals","are","stored","in","the","transformed","scale",".","out_sample_residuals",":","numpy","ndarray","Residuals","of","the","model","when","predicting","non","training","data",".","Only","stored","up","to","1000","values",".","If","`","transformer_y","`","is","not","`","None","`",",","residuals","are","assumed","to","be","in","the","transformed","scale",".","Use","`","set_out_sample_residuals","`","method","to","set","values",".","fitted",":","bool","Tag","to","identify","if","the","regressor","has","been","fitted","(","trained",")",".","creation_date",":","str","Date","of","creation",".","fit_date",":","str","Date","of","last","fit",".","skforecast_version",":","str","Version","of","skforecast","library","used","to","create","the","forecaster",".","python_version",":","str","Version","of","python","used","to","create","the","forecaster",".","forecaster_id",":","str",",","int","Name","used","as","an","identifier","of","the","forecaster","."]
docstr: Generate multiple forecasting predictions using a bootstrapping process. 
  By sampling from a collection of past observed errors (the residuals),
  each iteration of bootstrapping generates a different set of predictions. 
  See the Notes section for more information. 
  
  Parameters
  ----------
  steps : int
      Number of future steps predicted.
  last_window : pandas Series, default `None`
      Series values used to create the predictors (lags) needed in the 
      first iteration of the prediction (t + 1).
      If `last_window = None`, the values stored in `self.last_window` are
      used to calculate the initial predictors, and the predictions start
      right after training data.
  exog : pandas Series, pandas DataFrame, default `None`
      Exogenous variable/s included as predictor/s.
  n_boot : int, default `500`
      Number of bootstrapping iterations used to estimate predictions.
  random_state : int, default `123`
      Sets a seed to the random generator, so that boot predictions are always 
      deterministic.
  in_sample_residuals : bool, default `True`
      If `True`, residuals from the training data are used as proxy of
      prediction error to create predictions. If `False`, out of sample 
      residuals are used. In the latter case, the user should have
      calculated and stored the residuals within the forecaster (see
      `set_out_sample_residuals()`).
  
  Returns
  -------
  boot_predictions : pandas DataFrame
      Predictions generated by bootstrapping.
      Shape: (steps, n_boot)
  
  Notes
  -----
  More information about prediction intervals in forecasting:
  https://otexts.com/fpp3/prediction-intervals.html#prediction-intervals-from-bootstrapped-residuals
  Forecasting: Principles and Practice (3nd ed) Rob J Hyndman and George Athanasopoulos.
docstr_tok: ["Generate","multiple","forecasting","predictions","using","a","bootstrapping","process",".","By","sampling","from","a","collection","of","past","observed","errors","(","the","residuals",")",",","each","iteration","of","bootstrapping","generates","a","different","set","of","predictions",".","See","the","Notes","section","for","more","information",".","Parameters","--","--","--","--","--","steps",":","int","Number","of","future","steps","predicted",".","last_window",":","pandas","Series",",","default","`","None","`","Series","values","used","to","create","the","predictors","(","lags",")","needed","in","the","first","iteration","of","the","prediction","(","t","+","1",")",".","If","`","last_window","=","None","`",",","the","values","stored","in","`","self.last_window","`","are","used","to","calculate","the","initial","predictors",",","and","the","predictions","start","right","after","training","data",".","exog",":","pandas","Series",",","pandas","DataFrame",",","default","`","None","`","Exogenous","variable\/s","included","as","predictor\/s",".","n_boot",":","int",",","default","`","500","`","Number","of","bootstrapping","iterations","used","to","estimate","predictions",".","random_state",":","int",",","default","`","123","`","Sets","a","seed","to","the","random","generator",",","so","that","boot","predictions","are","always","deterministic",".","in_sample_residuals",":","bool",",","default","`","True","`","If","`","True","`",",","residuals","from","the","training","data","are","used","as","proxy","of","prediction","error","to","create","predictions",".","If","`","False","`",",","out","of","sample","residuals","are","used",".","In","the","latter","case",",","the","user","should","have","calculated","and","stored","the","residuals","within","the","forecaster","(","see","`","set_out_sample_residuals","(",")","`",")",".","Returns","--","--","--","-","boot_predictions",":","pandas","DataFrame","Predictions","generated","by","bootstrapping",".","Shape",":","(","steps",",","n_boot",")","Notes","--","--","-","More","information","about","prediction","intervals","in","forecasting",":","https",":","\/\/otexts.com\/fpp3\/prediction-intervals.html","#","prediction-intervals-from-bootstrapped-residuals","Forecasting",":","Principles","and","Practice","(","3nd","ed",")","Rob","J","Hyndman","and","George","Athanasopoulos","."]
code: def predict_bootstrapping(
      self,
      steps: int,
      last_window: Optional[pd.Series] = None,
      exog: Optional[Union[pd.Series, pd.DataFrame]] = None,
      n_boot: int = 500,
      random_state: int = 123,
      in_sample_residuals: bool = True,
  ) -> pd.DataFrame:
      """
      Generate multiple forecasting predictions using a bootstrapping process.
      By sampling from a collection of past observed errors (the residuals),
      each iteration of bootstrapping generates a different set of predictions.
      See the Notes section for more information.
  
      Parameters
      ----------
      steps : int
          Number of future steps predicted.
      last_window : pandas Series, default `None`
          Series values used to create the predictors (lags) needed in the
          first iteration of the prediction (t + 1).
          If `last_window = None`, the values stored in `self.last_window` are
          used to calculate the initial predictors, and the predictions start
          right after training data.
      exog : pandas Series, pandas DataFrame, default `None`
          Exogenous variable/s included as predictor/s.
      n_boot : int, default `500`
          Number of bootstrapping iterations used to estimate predictions.
      random_state : int, default `123`
          Sets a seed to the random generator, so that boot predictions are always
          deterministic.
      in_sample_residuals : bool, default `True`
          If `True`, residuals from the training data are used as proxy of
          prediction error to create predictions. If `False`, out of sample
          residuals are used. In the latter case, the user should have
          calculated and stored the residuals within the forecaster (see
          `set_out_sample_residuals()`).
  
      Returns
      -------
      boot_predictions : pandas DataFrame
          Predictions generated by bootstrapping.
          Shape: (steps, n_boot)
  
      Notes
      -----
      More information about prediction intervals in forecasting:
      https://otexts.com/fpp3/prediction-intervals.html#prediction-intervals-from-bootstrapped-residuals
      Forecasting: Principles and Practice (3nd ed) Rob J Hyndman and George Athanasopoulos.
  
      """
  
      if not in_sample_residuals and self.out_sample_residuals is None:
          raise ValueError(
              (
                  "`forecaster.out_sample_residuals` is `None`. Use "
                  "`in_sample_residuals=True` or method `set_out_sample_residuals()` "
                  "before `predict_interval()`, `predict_bootstrapping()`, "
                  "`predict_quantiles()` or `predict_dist()`."
              )
          )
  
      if last_window is None:
          last_window = self.last_window
  
      check_predict_input(
          forecaster_name=type(self).__name__,
          steps=steps,
          fitted=self.fitted,
          included_exog=self.included_exog,
          index_type=self.index_type,
          index_freq=self.index_freq,
          window_size=self.window_size,
          last_window=last_window,
          last_window_exog=None,
          exog=exog,
          exog_type=self.exog_type,
          exog_col_names=self.exog_col_names,
          interval=None,
          alpha=None,
          max_steps=None,
          levels=None,
          series_col_names=None,
      )
  
      last_window = last_window.iloc[-self.window_size :]
  
      if exog is not None:
          if isinstance(exog, pd.DataFrame):
              exog = transform_dataframe(
                  df=exog,
                  transformer=self.transformer_exog,
                  fit=False,
                  inverse_transform=False,
              )
          else:
              exog = transform_series(
                  series=exog,
                  transformer=self.transformer_exog,
                  fit=False,
                  inverse_transform=False,
              )
          exog_values = exog.to_numpy()[:steps]
      else:
          exog_values = None
  
      last_window = transform_series(
          series=last_window,
          transformer=self.transformer_y,
          fit=False,
          inverse_transform=False,
      )
      last_window_values, last_window_index = preprocess_last_window(
          last_window=last_window
      )
      if self.differentiation is not None:
          last_window_values = self.differentiator.fit_transform(
              last_window_values
          )
  
      boot_predictions = np.full(
          shape=(steps, n_boot), fill_value=np.nan, dtype=float
      )
      rng = np.random.default_rng(seed=random_state)
      seeds = rng.integers(low=0, high=10000, size=n_boot)
  
      if in_sample_residuals:
          residuals = self.in_sample_residuals
      else:
          residuals = self.out_sample_residuals
  
      for i in range(n_boot):
          # In each bootstraping iteration the initial last_window and exog
          # need to be restored.
          last_window_boot = last_window_values.copy()
          exog_boot = exog_values.copy() if exog is not None else None
  
          rng = np.random.default_rng(seed=seeds[i])
          sample_residuals = rng.choice(
              a=residuals, size=steps, replace=True
          )
  
          for step in range(steps):
              prediction = self._recursive_predict(
                  steps=1, last_window=last_window_boot, exog=exog_boot
              )
  
              prediction_with_residual = (
                  prediction + sample_residuals[step]
              )
              boot_predictions[step, i] = prediction_with_residual[0]
  
              last_window_boot = np.append(
                  last_window_boot[1:], prediction_with_residual
              )
  
              if exog is not None:
                  exog_boot = exog_boot[1:]
  
          if self.differentiation is not None:
              boot_predictions[
                  :, i
              ] = self.differentiator.inverse_transform_next_window(
                  boot_predictions[:, i]
              )
  
      boot_predictions = pd.DataFrame(
          data=boot_predictions,
          index=expand_index(last_window_index, steps=steps),
          columns=[f"pred_boot_{i}" for i in range(n_boot)],
      )
  
      if self.transformer_y:
          for col in boot_predictions.columns:
              boot_predictions[col] = transform_series(
                  series=boot_predictions[col],
                  transformer=self.transformer_y,
                  fit=False,
                  inverse_transform=True,
              )
  
      return boot_predictions
  
imports: from typing import Union, Tuple, Optional, Callable
  import warnings
  import logging
  import sys
  import numpy
  import pandas
  import sklearn
  import sklearn.pipeline
  from sklearn.base import clone
  import inspect
  import skforecast
  from ..ForecasterBase import ForecasterBase
  from ..utils import initialize_lags
  from ..utils import initialize_weights
  from ..utils import check_select_fit_kwargs
  from ..utils import check_y
  from ..utils import check_exog
  from ..utils import get_exog_dtypes
  from ..utils import check_exog_dtypes
  from ..utils import check_predict_input
  from ..utils import check_interval
  from ..utils import preprocess_y
  from ..utils import preprocess_last_window
  from ..utils import preprocess_exog
  from ..utils import expand_index
  from ..utils import transform_series
  from ..utils import transform_dataframe
  from ..preprocessing import TimeSeriesDifferentiator
label_desc: Use image node_id 9 for calling the ForecasterAutoreg obj's underlying member method code with example usage: obj.predict_bootstrapping(steps, last_window, exog, n_boot, random_state, in_sample_residuals) and returns: boot_predictions