class_docstr: Module level tests for all sktime forecasters.
class_docstr_tok: ["Module","level","tests","for","all","sktime","forecasters","."]
docstr: Check expected quantile prediction output.
docstr_tok: ["Check","expected","quantile","prediction","output","."]
code: def _check_predict_quantiles(
      self, pred_quantiles, y_train, fh, alpha
  ):
      """Check expected quantile prediction output."""
      # check expected type
      valid, msg, _ = check_is_mtype(
          pred_quantiles,
          mtype="pred_quantiles",
          scitype="Proba",
          return_metadata=True,
          msg_return_dict="list",
      )  # type: ignore
      assert valid, msg
  
      # check index (also checks forecasting horizon is more than one element)
      cutoff = get_cutoff(y_train, return_index=True)
      _assert_correct_pred_time_index(pred_quantiles.index, cutoff, fh)
  
      # check columns
  
      def get_expected_columns():
          if isinstance(y_train, pd.Series):
              if hasattr(y_train, "name") and y_train.name is not None:
                  return [y_train.name]
              else:
                  return [0]
          else:
              return y_train.columns
  
      expected_columns = get_expected_columns()
      expected_quantiles = (
          [alpha] if isinstance(alpha, float) else alpha
      )
      expected = pd.MultiIndex.from_product(
          [expected_columns, expected_quantiles]
      )
  
      found = pred_quantiles.columns.to_flat_index()
      msg = (
          "columns of returned quantile prediction DataFrame do not"
          f"match up with expected columns. Expected: {expected},"
          f"found: {found}"
      )
      assert all(expected == found), msg
  
      if isinstance(alpha, list):
          # sorts the columns that correspond to alpha values
          pred_quantiles = pred_quantiles.reindex(
              columns=pred_quantiles.columns.reindex(
                  sorted(alpha), level=1
              )[0]
          )
  
imports: import numpy
  import pandas
  import pytest
  from sktime.datatypes import check_is_mtype
  from sktime.datatypes._utilities import get_cutoff
  from sktime.exceptions import NotFittedError
  from sktime.forecasting.base._delegate import _DelegatedForecaster
  from sktime.forecasting.base._fh import ForecastingHorizon
  from sktime.forecasting.tests._config import TEST_ALPHAS, TEST_FHS, TEST_OOS_FHS, TEST_STEP_LENGTHS_INT, TEST_WINDOW_LENGTHS_INT, VALID_INDEX_FH_COMBINATIONS
  from sktime.performance_metrics.forecasting import mean_absolute_percentage_error
  from sktime.split import ExpandingWindowSplitter, SlidingWindowSplitter, temporal_train_test_split
  from sktime.tests.test_all_estimators import BaseFixtureGenerator, QuickTester
  from sktime.utils._testing.forecasting import _assert_correct_columns, _assert_correct_pred_time_index, _get_expected_index_for_update_predict, _get_n_columns, _make_fh, make_forecasting_problem
  from sktime.utils._testing.series import _make_series
  from sktime.utils.validation.forecasting import check_fh
label_desc: Use image node_id 12 for calling the TestAllForecasters obj's underlying member method code with example usage: obj._check_predict_quantiles(pred_quantiles, y_train, fh, alpha) and returns: y_train, list, list