class_docstr: A base class for forecast models. Fits a timeseries and predicts future values
  
  Parameters
  ----------
  score_func : callable, optional, default=mean_squared_error
      Function to calculate model R2_null_model_score score,
      with signature (actual, predicted).
      `actual`, `predicted` are array-like with the same shape.
      Smaller values are better.
  
  coverage : float, optional, default=0.95
      intended coverage of the prediction bands (0.0 to 1.0)
      If None, the upper/lower predictions are not returned by `predict`
  
      Every subclass must use `coverage` to set prediction band width. This ensures a common
      BaseForecastEstimator interface for parameters used during fitting and forecast evaluation
  
  null_model_params : dict with arguments passed to DummyRegressor, optional, default=None
      Dictionary keys must be in ("strategy", "constant", "quantile")
      Defines null model. model score is R2_null_model_score of model error relative to null model, evaluated by score_func
      If None, model score is score_func of the model itself
  
  Attributes
  ----------
  null_model : DummyEstimator
      null model used to measure model score
  time_col_ : str
      Name of input data time column
  value_col_ : str
      Name of input data value column
  last_predicted_X_ : `pandas.DataFrame` or None
      The ``X`` last passed to ``self.predict()``.
      Used to speed up predictions if the same ``X`` is passed repeatedly.
      Resets to None when ``self.fit()`` is called.
  cached_predictions_ : `pandas.DataFrame` or None
      The return value of the last call to ``self.predict()``.
      Used to speed up predictions if the same ``X`` is passed repeatedly.
      Resets to None when ``self.fit()`` is called.
class_docstr_tok: ["A","base","class","for","forecast","models",".","Fits","a","timeseries","and","predicts","future","values","Parameters","--","--","--","--","--","score_func",":","callable",",","optional",",","default=mean_squared_error","Function","to","calculate","model","R2_null_model_score","score",",","with","signature","(","actual",",","predicted",")",".","`","actual","`",",","`","predicted","`","are","array-like","with","the","same","shape",".","Smaller","values","are","better",".","coverage",":","float",",","optional",",","default=0.95","intended","coverage","of","the","prediction","bands","(","0.0","to","1.0",")","If","None",",","the","upper\/lower","predictions","are","not","returned","by","`","predict","`","Every","subclass","must","use","`","coverage","`","to","set","prediction","band","width",".","This","ensures","a","common","BaseForecastEstimator","interface","for","parameters","used","during","fitting","and","forecast","evaluation","null_model_params",":","dict","with","arguments","passed","to","DummyRegressor",",","optional",",","default=None","Dictionary","keys","must","be","in","(","``","strategy","''",",","``","constant","''",",","``","quantile","''",")","Defines","null","model",".","model","score","is","R2_null_model_score","of","model","error","relative","to","null","model",",","evaluated","by","score_func","If","None",",","model","score","is","score_func","of","the","model","itself","Attributes","--","--","--","--","--","null_model",":","DummyEstimator","null","model","used","to","measure","model","score","time_col_",":","str","Name","of","input","data","time","column","value_col_",":","str","Name","of","input","data","value","column","last_predicted_X_",":","`","pandas.DataFrame","`","or","None","The","``","X","``","last","passed","to","``","self.predict","(",")","``",".","Used","to","speed","up","predictions","if","the","same","``","X","``","is","passed","repeatedly",".","Resets","to","None","when","``","self.fit","(",")","``","is","called",".","cached_predictions_",":","`","pandas.DataFrame","`","or","None","The","return","value","of","the","last","call","to","``","self.predict","(",")","``",".","Used","to","speed","up","predictions","if","the","same","``","X","``","is","passed","repeatedly",".","Resets","to","None","when","``","self.fit","(",")","``","is","called","."]
docstr: Makes predictions of prediction intervals for ``df`` based on the predictions
  and ``self.uncertainty_model``.
  
  Parameters
  ----------
  df : `pandas.DataFrame`
      The dataframe to calculate prediction intervals upon.
      It should have either ``self.value_col_`` or
      `~greykite.common.constants.PREDICT_COL` which the
      prediction interval is based on.
  predict_params : `dict` [`str`, any] or None, default None
      Parameters to be passed to the ``predict`` function.
  
  Returns
  -------
  result_df : `pandas.DataFrame`
      The ``df`` with prediction interval columns.
docstr_tok: ["Makes","predictions","of","prediction","intervals","for","``","df","``","based","on","the","predictions","and","``","self.uncertainty_model","``",".","Parameters","--","--","--","--","--","df",":","`","pandas.DataFrame","`","The","dataframe","to","calculate","prediction","intervals","upon",".","It","should","have","either","``","self.value_col_","``","or","`","~greykite.common.constants.PREDICT_COL","`","which","the","prediction","interval","is","based","on",".","predict_params",":","`","dict","`","[","`","str","`",",","any","]","or","None",",","default","None","Parameters","to","be","passed","to","the","``","predict","``","function",".","Returns","--","--","--","-","result_df",":","`","pandas.DataFrame","`","The","``","df","``","with","prediction","interval","columns","."]
code: def predict_uncertainty(
      self, df: pd.DataFrame, predict_params: Optional[dict] = None
  ):
      """Makes predictions of prediction intervals for ``df`` based on the predictions
      and ``self.uncertainty_model``.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The dataframe to calculate prediction intervals upon.
          It should have either ``self.value_col_`` or
          `~greykite.common.constants.PREDICT_COL` which the
          prediction interval is based on.
      predict_params : `dict` [`str`, any] or None, default None
          Parameters to be passed to the ``predict`` function.
  
      Returns
      -------
      result_df : `pandas.DataFrame`
          The ``df`` with prediction interval columns.
      """
      # Skip prediction when no uncertainty model is trained.
      if self.uncertainty_model is None:
          log_message(
              message=f"The uncertainty model is not trained.",
              level=LoggingLevelEnum.WARNING,
          )
          return
  
      result_df = None
      # Tries to predict prediction intervals,
      # and skip if ``UncertaintyError`` occurred.
      try:
          if predict_params is None:
              predict_params = {}
          result_df = self.uncertainty_model.predict(
              df, **predict_params
          )
      except UncertaintyError as e:
          log_message(
              message=f"The following errors occurred during predicting the uncertainty model, "
              f"the uncertainty model is skipped. {e}",
              level=LoggingLevelEnum.WARNING,
          )
      return result_df
  
imports: from abc import ABC
  from abc import abstractmethod
  from typing import Optional
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.base import RegressorMixin
  from sklearn.metrics import mean_squared_error
  from greykite.common import constants
  from greykite.common.evaluation import r2_null_model_score
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.sklearn.estimator.null_model import DummyEstimator
  from greykite.sklearn.uncertainty.exceptions import UncertaintyError
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 7 for calling the BaseForecastEstimator obj's underlying member method code with example usage: obj.predict_uncertainty(df, predict_params) and returns: result_df