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: Compute/return prediction quantiles for a forecast.
  
  private _predict_quantiles containing the core logic,
      called from predict_quantiles and default _predict_interval
  
  Parameters
  ----------
  fh : guaranteed to be ForecastingHorizon
      The forecasting horizon with the steps ahead to to predict.
  X : optional (default=None)
      guaranteed to be of a type in self.get_tag("X_inner_mtype")
      Exogeneous time series to predict from.
  alpha : list of float, optional (default=[0.5])
      A list of probabilities at which quantile forecasts are computed.
  
  Returns
  -------
  quantiles : pd.DataFrame
      Column has multi-index: first level is variable name from y in fit,
          second level being the values of alpha passed to the function.
      Row index is fh, with additional (upper) levels equal to instance levels,
              from y seen in fit, if y_inner_mtype is Panel or Hierarchical.
      Entries are quantile forecasts, for var in col index,
          at quantile probability in second col index, for the row index.
docstr_tok: ["Compute\/return","prediction","quantiles","for","a","forecast",".","private","_predict_quantiles","containing","the","core","logic",",","called","from","predict_quantiles","and","default","_predict_interval","Parameters","--","--","--","--","--","fh",":","guaranteed","to","be","ForecastingHorizon","The","forecasting","horizon","with","the","steps","ahead","to","to","predict",".","X",":","optional","(","default=None",")","guaranteed","to","be","of","a","type","in","self.get_tag","(","``","X_inner_mtype","''",")","Exogeneous","time","series","to","predict","from",".","alpha",":","list","of","float",",","optional","(","default=","[","0.5","]",")","A","list","of","probabilities","at","which","quantile","forecasts","are","computed",".","Returns","--","--","--","-","quantiles",":","pd.DataFrame","Column","has","multi-index",":","first","level","is","variable","name","from","y","in","fit",",","second","level","being","the","values","of","alpha","passed","to","the","function",".","Row","index","is","fh",",","with","additional","(","upper",")","levels","equal","to","instance","levels",",","from","y","seen","in","fit",",","if","y_inner_mtype","is","Panel","or","Hierarchical",".","Entries","are","quantile","forecasts",",","for","var","in","col","index",",","at","quantile","probability","in","second","col","index",",","for","the","row","index","."]
code: def _predict_quantiles(self, fh, X, alpha):
      """Compute/return prediction quantiles for a forecast.
  
      private _predict_quantiles containing the core logic,
          called from predict_quantiles and default _predict_interval
  
      Parameters
      ----------
      fh : guaranteed to be ForecastingHorizon
          The forecasting horizon with the steps ahead to to predict.
      X : optional (default=None)
          guaranteed to be of a type in self.get_tag("X_inner_mtype")
          Exogeneous time series to predict from.
      alpha : list of float, optional (default=[0.5])
          A list of probabilities at which quantile forecasts are computed.
  
      Returns
      -------
      quantiles : pd.DataFrame
          Column has multi-index: first level is variable name from y in fit,
              second level being the values of alpha passed to the function.
          Row index is fh, with additional (upper) levels equal to instance levels,
                  from y seen in fit, if y_inner_mtype is Panel or Hierarchical.
          Entries are quantile forecasts, for var in col index,
              at quantile probability in second col index, for the row index.
      """
      implements_interval = self._has_implementation_of(
          "_predict_interval"
      )
      implements_proba = self._has_implementation_of("_predict_proba")
      can_do_proba = implements_interval or implements_proba
  
      if not can_do_proba:
          raise RuntimeError(
              f"{self.__class__.__name__} does not implement "
              "probabilistic forecasting, "
              'but "capability:pred_int" flag has been set to True incorrectly. '
              "This is likely a bug, please report, and/or set the flag to False."
          )
  
      if implements_interval:
          pred_int = pd.DataFrame()
          for a in alpha:
              # compute quantiles corresponding to prediction interval coverage
              #  this uses symmetric predictive intervals:
              coverage = abs(1 - 2 * a)
  
              # compute quantile forecasts corresponding to upper/lower
              pred_a = self._predict_interval(
                  fh=fh, X=X, coverage=[coverage]
              )
              pred_int = pd.concat([pred_int, pred_a], axis=1)
  
          # now we need to subset to lower/upper depending
          #   on whether alpha was < 0.5 or >= 0.5
          #   this formula gives the integer column indices giving lower/upper
          col_selector_int = (np.array(alpha) >= 0.5) + 2 * np.arange(
              len(alpha)
          )
          col_selector_bool = np.isin(
              np.arange(2 * len(alpha)), col_selector_int
          )
          num_var = len(pred_int.columns.get_level_values(0).unique())
          col_selector_bool = np.tile(col_selector_bool, num_var)
  
          pred_int = pred_int.iloc[:, col_selector_bool]
          # change the column labels (multiindex) to the format for intervals
          # idx returned by _predict_interval is
          #   3-level MultiIndex with variable names, coverage, lower/upper
          # idx returned by _predict_quantiles should be
          #   is 2-level MultiIndex with variable names, alpha
          int_idx = self._get_columns(
              method="predict_quantiles", alpha=alpha
          )
          pred_int.columns = int_idx
  
      elif implements_proba:
          pred_proba = self.predict_proba(fh=fh, X=X)
          pred_int = pred_proba.quantile(alpha=alpha)
  
      return pred_int
  
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 35 for calling the BaseForecaster obj's underlying member method code with example usage: obj._predict_quantiles(fh, X, alpha) and returns: pred_int