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 predict_item(self, entry: DataEntry) -> QuantileForecast:
      kwargs = {}
      if self.config.intervals is not None and all(
          [
              proportion not in _build_fn_name(self.hrec.reconcilers[0])
              for proportion in [
                  "forecast_proportions",
                  "average_proportions",
                  "proportion_averages",
              ]
          ]
      ):
          kwargs["level"] = self.config.intervals
  
      Y_df = format_data_entry(entry, self.S)
  
      # set up forecaster
      forecaster = StatsForecast(
          df=Y_df,
          models=self.models,
          freq=entry["start"].freq,
          n_jobs=self.n_jobs,
      )
  
      # compute base forecasts
      Y_hat_df = forecaster.forecast(
          h=self.prediction_length, fitted=self.fitted, **kwargs
      )
  
      params = dict(
          Y_hat_df=Y_hat_df,
          S=self.S,
          tags=self.tags,
          intervals_method=self.intervals_method,
          **kwargs,
      )
  
      if self.fitted:
          params["Y_df"] = forecaster.forecast_fitted_values()
      else:
          params["Y_df"] = Y_df
  
      # reconcile forecasts
      Y_hat_df_rec = self.hrec.reconcile(**params)
  
      # select relevant columns and rename
      Y_hat_df_rec = prune_fcst_df(
          Y_hat_df_rec, self.base_reconciliation_model_name
      )
  
      # if only mean fcst is computed, we take it as all requested quantiles
      if len(Y_hat_df_rec.columns) == 2 and all(
          Y_hat_df_rec.columns == ["ds", "mean"]
      ):
          fcst_col_names = ["mean"] * len(
              self.config.statsforecast_keys
          )
      else:
          fcst_col_names = self.config.statsforecast_keys
  
      # prepare for QuantileForecast format
      forecast_arrays = np.array(
          [
              format_reconciled_forecasts(
                  df=Y_hat_df_rec,
                  fcst_col_name=fcst_col_names[e],
                  prediction_length=self.prediction_length,
                  S=self.S,
              )
              for e, k in enumerate(self.config.statsforecast_keys)
          ]
      )
  
      return QuantileForecast(
          forecast_arrays=forecast_arrays,
          forecast_keys=self.config.forecast_keys,
          start_date=forecast_start(entry),
          item_id=entry.get("item_id"),
          info=entry.get("info"),
      )
  
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 2 for calling the HierarchicalForecastPredictor obj's underlying member method code with example usage: obj.predict_item(entry) and returns: QuantileForecast