class_docstr: The quantile regression based uncertainty model.
  Predicts quantiles as the prediction intervals.
  The quantiles are calculated based on the ``coverage`` parameter.
  For example, a 90% prediction interval is the 0.05 quantile and 0.95 quantile predictions.
  
  There are four scenarios:
  
      - ``is_residual_based = False`` and ``x_mat`` is provided.
        In this case, the method fits two quantile regression models based on the ``value_col`` and ``x_mat``.
        Depending on the forecast model, the generated prediction intervals may not cover the forecasted values.
      - ``is_residual_based = False`` and ``x_mat`` is not provided.
        In this case, a ``x_mat`` is generated based on ``time_col``
        including linear growth and yearly/weekly seasonality.
        Currently we do not support customizing the generation of this feature matrix.
        The method fits two quantile regression models based on ``value_col`` and the generated ``x_mat``.
        Depending on the forecast model, the generated prediction intervals may not cover the forecasted values.
      - ``is_residual_based = True`` and ``x_mat`` is provided.
        In this case, the ``predicted_col`` needs to be provided
        in addition to ``value_col`` to calculate the residuals.
        The method fits two quantile regression models based on the residuals and ``x_mat``.
        The fitted residual quantiles are added to the forecasted values.
      - ``is_residual_based = True`` and ``x_mat`` is not provided.
        In this case, the ``predicted_col`` needs to be provided
        in addition to ``value_col`` to calculate the residuals.
        In this case, a ``x_mat`` is generated based on ``time_col``
        including linear growth and yearly/weekly seasonality.
        Currently we do not support customizing the generation of this feature matrix.
        The method fits two quantile regression models based on residuals and the generated ``x_mat``.
        The fitted residual quantiles are added to the forecasted values.
  
  If ``x_mat`` is not provided, ``time_col`` must be provided to build the feature matrix.
  
  If ``is_residual_based = False``, then ``value_col`` must be provided to train the model.
  If ``is_residual_based = True``, then both ``value_col`` and ``predicted_col`` must be provided.
  In this case, the method also tries to find ``cst.PREDICTED_COL`` in the training data
  too if ``predicted_col`` is not provided.
  
  Attributes
  ----------
  uncertainty_dict : `dict` [`str`, any]
      The uncertainty model specification. It should have the following keys:
  
              "uncertainty_method": a string that is in
                  `~greykite.sklearn.uncertainty.uncertainty_methods.UncertaintyMethodEnum`.
              "params": a dictionary that includes any additional parameters needed by the uncertainty method.
                        Expected keys include: "value_col", "predicted_col", "is_residual_based"
                        and "quantiles".
  
  UNCERTAINTY_METHOD : `str`
      The name for the uncertainty method.
  REQUIRED_PARAMS : `list` [`str`]
      A list of required parameters for the method.
  coverage : `float`
      The coverage of the uncertainty intervals.
      Will be used to calculate the quantiles.
  time_col : `str`
      The column name for timestamps in ``train_df`` and ``fut_df``.
  value_col : `str` or None
      The column name for values in ``train_df`` and ``fut_df``.
  predicted_col : `str` or None
      The column name for predicted values in ``train_df`` and ``fut_df``.
  residual_col : `str` or None
      The column name for residuals in ``train_df``.
  quantiles : `list` [`float`] or None
      A list of quantiles to be fitted.
      This is also derived from the ``coverage`` parameter.
  is_residual_based : `bool` or None
      Whether to fit the original values or residuals.
  models : `list` [`QuantileRegression`] or None
      A list of trained quantile regression models.
  x_mat : `pandas.DataFrame` or None
      The feature matrix used to fit the model.
  build_x_mat : `bool` or None
      Whether the feature matrix is built. If False, it is provided.
  distribution_col : `str` or None
      The column name for the column used as response in fitting the quantile regression models.
  offset_col : `str` or None
      The column name for the column used to offset the predicted intervals.
docstr: Predicts the interval.
  
  Parameters
  ----------
  fut_df : `pandas.DataFrame`
      The dataframe used for prediction.
      Must have the following columns:
  
          time_col: if ``x_mat`` is not given during the training phase.
          predicted_col: if ``is_residual_based=True``, used to offset the predictions.
  
  x_mat : `pandas.DataFrame` or None, default None
      The feature matrix used for prediction.
      If an ``x_mat`` was provided during training, it should be provided during prediction too.
  
  Returns
  -------
  result_df : `pandas.DataFrame`
      The ``fut_df`` augmented with prediction intervals.
docstr_tok: ["Predicts","the","interval",".","Parameters","--","--","--","--","--","fut_df",":","`","pandas.DataFrame","`","The","dataframe","used","for","prediction",".","Must","have","the","following","columns",":","time_col",":","if","``","x_mat","``","is","not","given","during","the","training","phase",".","predicted_col",":","if","``","is_residual_based=True","``",",","used","to","offset","the","predictions",".","x_mat",":","`","pandas.DataFrame","`","or","None",",","default","None","The","feature","matrix","used","for","prediction",".","If","an","``","x_mat","``","was","provided","during","training",",","it","should","be","provided","during","prediction","too",".","Returns","--","--","--","-","result_df",":","`","pandas.DataFrame","`","The","``","fut_df","``","augmented","with","prediction","intervals","."]
code: def predict(
      self, fut_df: pd.DataFrame, x_mat: Optional[pd.DataFrame] = None
  ):
      """Predicts the interval.
  
      Parameters
      ----------
      fut_df : `pandas.DataFrame`
          The dataframe used for prediction.
          Must have the following columns:
  
              time_col: if ``x_mat`` is not given during the training phase.
              predicted_col: if ``is_residual_based=True``, used to offset the predictions.
  
      x_mat : `pandas.DataFrame` or None, default None
          The feature matrix used for prediction.
          If an ``x_mat`` was provided during training, it should be provided during prediction too.
  
      Returns
      -------
      result_df : `pandas.DataFrame`
          The ``fut_df`` augmented with prediction intervals.
      """
      if self.models is None:
          raise NotFittedError(
              "Please train the uncertainty model first."
          )
      fut_df = fut_df.copy()
      # Records the originals columns to be output.
      output_cols = list(fut_df.columns)
  
      # Builds x mat if needed.
      if self.build_x_mat:
          if self.time_col not in fut_df:
              raise UncertaintyError(
                  f"Time column {self.time_col} not found in `fut_df`."
              )
          x_mat = self._build_quantile_regression_features(
              training_phase=False, fut_df=fut_df
          )
      else:
          if x_mat is None:
              raise UncertaintyError(
                  "Please provide `x_mat` for prediction."
              )
          if len(fut_df) != len(x_mat):
              raise UncertaintyError(
                  f"The size of `fut_df` {len(fut_df)} must be the same "
                  f"as the size of `x_mat` {len(x_mat)}."
              )
          try:
              x_mat = x_mat[self.x_mat.columns]
          except KeyError:
              raise UncertaintyError(
                  f"The `x_mat` does not have all columns used to train the uncertainty model. "
                  f"The following columns are missing: "
                  f"{[col for col in self.x_mat.columns if col not in x_mat.columns]}."
              )
  
      # Makes predictions to the quantiles.
      predictions = [model.predict(x_mat) for model in self.models]
  
      # Calculates the offset values.
      if self.is_residual_based:
          offset_col = fut_df[self.offset_col].values
      else:
          offset_col = 0
  
      # Creates the quantile columns.
      for quantile, prediction in zip(self.quantiles, predictions):
          fut_df[f"{cst.PREDICTED_COL}_{round(quantile, 3)}"] = (
              prediction + offset_col
          )
  
      # Sets the upper/lower bounds.
      fut_df[cst.PREDICTED_LOWER_COL] = fut_df[
          f"{cst.PREDICTED_COL}_{round(min(self.quantiles), 3)}"
      ]
      fut_df[cst.PREDICTED_UPPER_COL] = fut_df[
          f"{cst.PREDICTED_COL}_{round(max(self.quantiles), 3)}"
      ]
  
      output_cols += [cst.PREDICTED_LOWER_COL, cst.PREDICTED_UPPER_COL]
      output_cols += [
          f"{cst.PREDICTED_COL}_{round(quantile, 3)}"
          for quantile in self.quantiles
      ]
  
      return fut_df[output_cols]
  
imports: from __future__ import annotations
  from typing import Dict
  from typing import List
  from typing import Optional
  import pandas
  from sklearn.exceptions import NotFittedError
  from greykite.algo.common.l1_quantile_regression import QuantileRegression
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_silverkite_helper import get_fourier_feature_col_names
  from greykite.algo.forecast.silverkite.forecast_silverkite_helper import get_silverkite_uncertainty_dict
  from greykite.common import constants
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
  from greykite.sklearn.uncertainty.base_uncertainty_model import BaseUncertaintyModel
  from greykite.sklearn.uncertainty.exceptions import UncertaintyError
label_desc: Use image node_id 5 for calling the QuantileRegressionUncertaintyModel obj's underlying member method code with example usage: obj.predict(fut_df, x_mat) and returns: fut_df