class_docstr: Base class for interfacing tbats forecasting algorithms.
class_docstr_tok: ["Base","class","for","interfacing","tbats","forecasting","algorithms","."]
docstr: Compute/return prediction quantiles for a forecast.
  
  private _predict_interval containing the core logic,
      called from predict_interval and possibly predict_quantiles
  
  Note: In-sample forecasts are set to NaNs, since TBATS does not support it.
  
  State required:
      Requires state to be "fitted".
  
  Accesses in self:
      Fitted model attributes ending in "_"
      self.cutoff
  
  Parameters
  ----------
  fh : int, list, np.array or ForecastingHorizon
      Forecasting horizon, default = y.index (in-sample forecast)
  X : pd.DataFrame, optional (default=None)
      Ignored, passed for interface compatibility
  coverage : list of float (guaranteed not None and floats in [0,1] interval)
     nominal coverage(s) of predictive interval(s)
  
  Returns
  -------
  pred_int : pd.DataFrame
      Column has multi-index: first level is variable name from y in fit,
          second level coverage fractions for which intervals were computed.
              in the same order as in input `coverage`.
          Third level is string "lower" or "upper", for lower/upper interval end.
      Row index is fh. Entries are forecasts of lower/upper interval end,
          for var in col index, at nominal coverage in second col index,
          lower/upper depending on third col index, for the row index.
          Upper/lower interval end forecasts are equivalent to
          quantile forecasts at alpha = 0.5 - c/2, 0.5 + c/2 for c in coverage.
docstr_tok: ["Compute\/return","prediction","quantiles","for","a","forecast",".","private","_predict_interval","containing","the","core","logic",",","called","from","predict_interval","and","possibly","predict_quantiles","Note",":","In-sample","forecasts","are","set","to","NaNs",",","since","TBATS","does","not","support","it",".","State","required",":","Requires","state","to","be","``","fitted","''",".","Accesses","in","self",":","Fitted","model","attributes","ending","in","``","_","''","self.cutoff","Parameters","--","--","--","--","--","fh",":","int",",","list",",","np.array","or","ForecastingHorizon","Forecasting","horizon",",","default","=","y.index","(","in-sample","forecast",")","X",":","pd.DataFrame",",","optional","(","default=None",")","Ignored",",","passed","for","interface","compatibility","coverage",":","list","of","float","(","guaranteed","not","None","and","floats","in","[","0,1","]","interval",")","nominal","coverage","(","s",")","of","predictive","interval","(","s",")","Returns","--","--","--","-","pred_int",":","pd.DataFrame","Column","has","multi-index",":","first","level","is","variable","name","from","y","in","fit",",","second","level","coverage","fractions","for","which","intervals","were","computed",".","in","the","same","order","as","in","input","`","coverage","`",".","Third","level","is","string","``","lower","''","or","``","upper","''",",","for","lower\/upper","interval","end",".","Row","index","is","fh",".","Entries","are","forecasts","of","lower\/upper","interval","end",",","for","var","in","col","index",",","at","nominal","coverage","in","second","col","index",",","lower\/upper","depending","on","third","col","index",",","for","the","row","index",".","Upper\/lower","interval","end","forecasts","are","equivalent","to","quantile","forecasts","at","alpha","=","0.5","-","c\/2",",","0.5","+","c\/2","for","c","in","coverage","."]
code: def _predict_interval(self, fh, X, coverage):
      """Compute/return prediction quantiles for a forecast.
  
      private _predict_interval containing the core logic,
          called from predict_interval and possibly predict_quantiles
  
      Note: In-sample forecasts are set to NaNs, since TBATS does not support it.
  
      State required:
          Requires state to be "fitted".
  
      Accesses in self:
          Fitted model attributes ending in "_"
          self.cutoff
  
      Parameters
      ----------
      fh : int, list, np.array or ForecastingHorizon
          Forecasting horizon, default = y.index (in-sample forecast)
      X : pd.DataFrame, optional (default=None)
          Ignored, passed for interface compatibility
      coverage : list of float (guaranteed not None and floats in [0,1] interval)
         nominal coverage(s) of predictive interval(s)
  
      Returns
      -------
      pred_int : pd.DataFrame
          Column has multi-index: first level is variable name from y in fit,
              second level coverage fractions for which intervals were computed.
                  in the same order as in input `coverage`.
              Third level is string "lower" or "upper", for lower/upper interval end.
          Row index is fh. Entries are forecasts of lower/upper interval end,
              for var in col index, at nominal coverage in second col index,
              lower/upper depending on third col index, for the row index.
              Upper/lower interval end forecasts are equivalent to
              quantile forecasts at alpha = 0.5 - c/2, 0.5 + c/2 for c in coverage.
      """
      cutoff = self.cutoff
  
      # accumulator of results
      var_names = self._get_varnames()
      var_name = var_names[0]
  
      int_idx = pd.MultiIndex.from_product(
          [var_names, coverage, ["lower", "upper"]]
      )
      pred_int = pd.DataFrame(
          columns=int_idx, index=fh.to_absolute_index(cutoff)
      )
  
      for c in coverage:
          # separate treatment for "0" coverage: upper/lower = point prediction
          if c == 0:
              pred_int[(var_name, 0, "lower")] = self._tbats_forecast(
                  fh
              )
              pred_int[(var_name, 0, "upper")] = pred_int[
                  (var_name, 0, "lower")
              ]
              continue
  
          # tbats prediction intervals
          tbats_pred_int = self._tbats_forecast_interval(fh, c)
  
          pred_int[(var_name, c, "lower")] = tbats_pred_int["lower"]
          pred_int[(var_name, c, "upper")] = tbats_pred_int["upper"]
  
      return pred_int
  
file_path: sktime/sktime/forecasting/base/adapters/_tbats.py
imports: import numpy
  import pandas
  from sktime.forecasting.base import BaseForecaster
  from sktime.utils.validation import check_n_jobs
  from sktime.utils.validation.forecasting import check_sp
label_desc: Use image node_id 10 for calling the _TbatsAdapter obj's underlying member method code with example usage: obj._predict_interval(fh, X, coverage) and returns: pred_int