class_docstr: A predictor that wraps models from the `hierarchicalforecast`_ package.
  
  .. hierarchicalforecast: https://github.com/Nixtla/hierarchicalforecast
  
  Parameters
  ----------
  prediction_length
      Prediction length for the model to use.
  base_model
      forecaster to use for base forecasts. Please refer to the documentation
      of ``statsforecast`` for available options.
      Example: AutoARIMA
  reconciler
      forecast reconciliation method to use. Please see the documentation
      of ``hierarchicalforecast`` for available options.
      Example: BottomUp
  S
      Summation or aggregation matrix.
  tags
      Each key is a level with values of tags associated to that level
  ts_names
      ordered list with names of time series
  intervals_method
      method used to calculate prediction intervals.
      Options are `normality`, `bootstrap`, `permbu`.
  quantile_levels
      Optional list of quantile levels that we want predictions for.
      Note: this is only supported by specific types of models, such as
      ``AutoARIMA``. By default this is ``None``, giving only the mean
      prediction.
  n_jobs
      number of jobs used in the parallel processing, use -1 for all cores.
  model_params
      dictionary with inputs parameters for base_model,
      i.e. {"season_length": 2}
  reconciler_params
      dictionary with input parameters for reconciler,
      i.e. {"method": "average_proportions"}
class_docstr_tok: ["A","predictor","that","wraps","models","from","the","`","hierarchicalforecast","`","_","package",".","..","hierarchicalforecast",":","https",":","\/\/github.com\/Nixtla\/hierarchicalforecast","Parameters","--","--","--","--","--","prediction_length","Prediction","length","for","the","model","to","use",".","base_model","forecaster","to","use","for","base","forecasts",".","Please","refer","to","the","documentation","of","``","statsforecast","``","for","available","options",".","Example",":","AutoARIMA","reconciler","forecast","reconciliation","method","to","use",".","Please","see","the","documentation","of","``","hierarchicalforecast","``","for","available","options",".","Example",":","BottomUp","S","Summation","or","aggregation","matrix",".","tags","Each","key","is","a","level","with","values","of","tags","associated","to","that","level","ts_names","ordered","list","with","names","of","time","series","intervals_method","method","used","to","calculate","prediction","intervals",".","Options","are","`","normality","`",",","`","bootstrap","`",",","`","permbu","`",".","quantile_levels","Optional","list","of","quantile","levels","that","we","want","predictions","for",".","Note",":","this","is","only","supported","by","specific","types","of","models",",","such","as","``","AutoARIMA","``",".","By","default","this","is","``","None","``",",","giving","only","the","mean","prediction",".","n_jobs","number","of","jobs","used","in","the","parallel","processing",",","use","-1","for","all","cores",".","model_params","dictionary","with","inputs","parameters","for","base_model",",","i.e",".","{","``","season_length","''",":","2","}","reconciler_params","dictionary","with","input","parameters","for","reconciler",",","i.e",".","{","``","method","''",":","``","average_proportions","''","}"]
code: def __init__(
      self,
      prediction_length: int,
      base_model: Any,
      reconciler: Any,
      S: Union[List[List[int]], np.ndarray],
      tags: Dict[str, Union[List, np.ndarray]] = {},
      ts_names: Optional[List[str]] = None,
      intervals_method: str = "normality",
      quantile_levels: Optional[List[float]] = None,
      n_jobs: int = 1,
      model_params: Dict[str, Any] = {},
      reconciler_params: Dict[str, Any] = {},
  ) -> None:
      super().__init__(prediction_length=prediction_length)
  
      assert intervals_method in ["normality", "bootstrap", "permbu"]
  
      if tags and ts_names:
          assert set(
              [x for values in tags.values() for x in values]
          ) == set(
              ts_names
          ), "tags and ts_names must have the same set of ts names"
  
      self.models = [base_model(**model_params)]
      self.hrec = HierarchicalReconciliation(
          reconcilers=[reconciler(**reconciler_params)]
      )
      self.ts_names = (
          ts_names
          if ts_names is not None
          else [str(x) for x in range(len(S))]
      )
      self.S = get_formatted_S(S, self.ts_names)
      self.tags = {key: np.array(val) for key, val in tags.items()}
      self.intervals_method = intervals_method
      self.n_jobs = n_jobs
      self.config = ModelConfig(
          quantile_levels=quantile_levels,
      )
      self.base_reconciliation_model_name = (
          f"{repr(self.models[0])}/"
          f"{_build_fn_name(self.hrec.reconcilers[0])}"
      )
      self.fitted = (
          repr(self.models[0]) not in models_without_fitted_capability
      )
  
imports: from typing import List, Optional, Union, Any, Dict
  import numpy
  import pandas
  from statsforecast import StatsForecast
  from hierarchicalforecast.core import HierarchicalReconciliation
  from hierarchicalforecast.core import _build_fn_name
  from gluonts.core.component import validated
  from gluonts.dataset import DataEntry
  from gluonts.dataset.util import forecast_start
  from gluonts.model.predictor import RepresentablePredictor
  from gluonts.model.forecast import QuantileForecast
  from gluonts.ext.statsforecast import ModelConfig
label_desc: Use image node_id 1 to create a new HierarchicalForecastPredictor object from inherited base classes: RepresentablePredictor with example: obj = HierarchicalForecastPredictor(prediction_length, base_model, reconciler, S, tags, ts_names, intervals_method, quantile_levels, n_jobs, model_params, reconciler_params)