class_docstr: Module level tests for all sktime forecasters.
class_docstr_tok: ["Module","level","tests","for","all","sktime","forecasters","."]
docstr: Check prediction intervals returned by predict_interval.
  
  Arguments
  ---------
  estimator_instance : BaseEstimator class descendant instance, forecaster to test
  n_columns : number of columns for the test data
  index_type : index type of the test data
  fh_int_oos : forecasting horizon to test the forecaster at, all out of sample
  coverage: float, coverage at which to make prediction intervals
  
  Raises
  ------
  AssertionError - if Forecaster test instance has "capability:pred_int"
          and pred. int are not returned correctly when calling predict_interval
  AssertionError - if Forecaster test instance does not have "capability:pred_int"
          and no NotImplementedError is raised when calling predict_interval
docstr_tok: ["Check","prediction","intervals","returned","by","predict_interval",".","Arguments","--","--","--","--","-","estimator_instance",":","BaseEstimator","class","descendant","instance",",","forecaster","to","test","n_columns",":","number","of","columns","for","the","test","data","index_type",":","index","type","of","the","test","data","fh_int_oos",":","forecasting","horizon","to","test","the","forecaster","at",",","all","out","of","sample","coverage",":","float",",","coverage","at","which","to","make","prediction","intervals","Raises","--","--","--","AssertionError","-","if","Forecaster","test","instance","has","``","capability",":","pred_int","''","and","pred",".","int","are","not","returned","correctly","when","calling","predict_interval","AssertionError","-","if","Forecaster","test","instance","does","not","have","``","capability",":","pred_int","''","and","no","NotImplementedError","is","raised","when","calling","predict_interval"]
code: def test_predict_interval(
      self,
      estimator_instance,
      n_columns,
      index_type,
      fh_int_oos,
      coverage,
  ):
      """Check prediction intervals returned by predict_interval.
  
      Arguments
      ---------
      estimator_instance : BaseEstimator class descendant instance, forecaster to test
      n_columns : number of columns for the test data
      index_type : index type of the test data
      fh_int_oos : forecasting horizon to test the forecaster at, all out of sample
      coverage: float, coverage at which to make prediction intervals
  
      Raises
      ------
      AssertionError - if Forecaster test instance has "capability:pred_int"
              and pred. int are not returned correctly when calling predict_interval
      AssertionError - if Forecaster test instance does not have "capability:pred_int"
              and no NotImplementedError is raised when calling predict_interval
      """
      y_train = _make_series(n_columns=n_columns, index_type=index_type)
      estimator_instance.fit(y_train, fh=fh_int_oos)
      if estimator_instance.get_tag("capability:pred_int"):
          pred_ints = estimator_instance.predict_interval(
              fh=fh_int_oos, coverage=coverage
          )
          self._check_predict_intervals(
              pred_ints,
              y_train,
              fh_int_oos,
              coverage,
          )
      else:
          with pytest.raises(
              NotImplementedError, match="prediction intervals"
          ):
              estimator_instance.predict_interval(
                  fh_int_oos, coverage=coverage
              )
  
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 11 for calling the TestAllForecasters obj's underlying member method code with example usage: obj.test_predict_interval(estimator_instance, n_columns, index_type, fh_int_oos, coverage) without return types