class_docstr: Module level tests for all sktime forecasters.
class_docstr_tok: ["Module","level","tests","for","all","sktime","forecasters","."]
docstr: Checks whether the capability:pred_int tag is correctly set.
  
  Arguments
  ---------
  estimator_instance : instance of BaseForecaster
  
  Raises
  ------
  ValueError - if capability:pred_int is True, but neither
      predict_interval nor predict_quantiles have implemented content
      this can be by direct implementation of _predict_interval/_predict_quantiles
      or by defaulting to each other and/or _predict_proba
docstr_tok: ["Checks","whether","the","capability",":","pred_int","tag","is","correctly","set",".","Arguments","--","--","--","--","-","estimator_instance",":","instance","of","BaseForecaster","Raises","--","--","--","ValueError","-","if","capability",":","pred_int","is","True",",","but","neither","predict_interval","nor","predict_quantiles","have","implemented","content","this","can","be","by","direct","implementation","of","_predict_interval\/_predict_quantiles","or","by","defaulting","to","each","other","and\/or","_predict_proba"]
code: def test_pred_int_tag(self, estimator_instance):
      """Checks whether the capability:pred_int tag is correctly set.
  
      Arguments
      ---------
      estimator_instance : instance of BaseForecaster
  
      Raises
      ------
      ValueError - if capability:pred_int is True, but neither
          predict_interval nor predict_quantiles have implemented content
          this can be by direct implementation of _predict_interval/_predict_quantiles
          or by defaulting to each other and/or _predict_proba
      """
      f = estimator_instance
      # we skip the _DelegatedForecaster, since it implements delegation methods
      #   which may look like the method is implemented, but in fact it is not
      if isinstance(f, _DelegatedForecaster):
          return None
  
      # PR #4465 adds base ``_predict_interval`` in ``_StatsModelsAdapter``.
      # This leads to existence of that non-functional method in all subclasses.
      # It causes failure in ``test_pred_int_tag`` tests, which are skipped below.
      # The following skips this test for all subclasses of ``_StatsModelsAdapter``.
      # This weakens coverage for valid subclasses with probabilistic capability.
      # This should be addressed in future and is being tracked in issue #4482.
      contains_interval_adapter = hasattr(
          f, "_extract_conf_int"
      ) and callable(f._extract_conf_int)
      implements_interval_adapter = f._has_implementation_of(
          "_extract_conf_int"
      )
  
      if contains_interval_adapter and not implements_interval_adapter:
          return None
  
      # check which methods are implemented
      implements_interval = f._has_implementation_of(
          "_predict_interval"
      )
      implements_quantiles = f._has_implementation_of(
          "_predict_quantiles"
      )
      implements_proba = f._has_implementation_of("_predict_proba")
  
      pred_int_works = (
          implements_interval
          or implements_quantiles
          or implements_proba
      )
  
      if not pred_int_works and f.get_class_tag(
          "capability:pred_int", False
      ):
          raise ValueError(
              f"{type(f).__name__} does not implement probabilistic forecasting, "
              'but "capability:pred_int" flag has been set to True incorrectly. '
              'The flag "capability:pred_int" should instead be set to False.'
          )
  
      if pred_int_works and not f.get_class_tag(
          "capability:pred_int", False
      ):
          raise ValueError(
              f"{type(f).__name__} does implement probabilistic forecasting, "
              'but "capability:pred_int" flag has been set to False incorrectly. '
              'The flag "capability:pred_int" should instead be set to True.'
          )
  
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 16 for calling the TestAllForecasters obj's underlying member method code with example usage: obj.test_pred_int_tag(estimator_instance) and returns: None, None