class_docstr: Abstract class wrapping GluonTS estimators for use in autogluon.timeseries.
  
  Parameters
  ----------
  path: str
      directory to store model artifacts.
  freq: str
      string representation (compatible with GluonTS frequency strings) for the data provided.
      For example, "1D" for daily data, "1H" for hourly data, etc.
  prediction_length: int
      Number of time steps ahead (length of the forecast horizon) the model will be optimized
      to predict. At inference time, this will be the number of time steps the model will
      predict.
  name: str
      Name of the model. Also, name of subdirectory inside path where model will be saved.
  eval_metric: str
      objective function the model intends to optimize, will use WQL by default.
  hyperparameters:
      various hyperparameters that will be used by model (can be search spaces instead of
      fixed values). See *Other Parameters* in each inheriting model's documentation for
      possible values.
class_docstr_tok: ["Abstract","class","wrapping","GluonTS","estimators","for","use","in","autogluon.timeseries",".","Parameters","--","--","--","--","--","path",":","str","directory","to","store","model","artifacts",".","freq",":","str","string","representation","(","compatible","with","GluonTS","frequency","strings",")","for","the","data","provided",".","For","example",",","``","1D","''","for","daily","data",",","``","1H","''","for","hourly","data",",","etc",".","prediction_length",":","int","Number","of","time","steps","ahead","(","length","of","the","forecast","horizon",")","the","model","will","be","optimized","to","predict",".","At","inference","time",",","this","will","be","the","number","of","time","steps","the","model","will","predict",".","name",":","str","Name","of","the","model",".","Also",",","name","of","subdirectory","inside","path","where","model","will","be","saved",".","eval_metric",":","str","objective","function","the","model","intends","to","optimize",",","will","use","WQL","by","default",".","hyperparameters",":","various","hyperparameters","that","will","be","used","by","model","(","can","be","search","spaces","instead","of","fixed","values",")",".","See","*","Other","Parameters","*","in","each","inheriting","model","'s","documentation","for","possible","values","."]
code: def _stack_sample_forecasts(
      self, forecasts: List[SampleForecast], item_ids: pd.Index
  ) -> pd.DataFrame:
      item_id_to_forecast = {str(f.item_id): f for f in forecasts}
      samples_per_item = []
      for item_id in item_ids:
          forecast = item_id_to_forecast[str(item_id)]
          samples_per_item.append(forecast.samples.T)
      samples = np.concatenate(samples_per_item, axis=0)
      quantiles = np.quantile(samples, self.quantile_levels, axis=1).T
      mean = samples.mean(axis=1, keepdims=True)
      forecast_array = np.concatenate([mean, quantiles], axis=1)
      return pd.DataFrame(
          forecast_array,
          columns=["mean"] + [str(q) for q in self.quantile_levels],
      )
  
imports: import logging
  import os
  import shutil
  from datetime import timedelta
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union
  import gluonts
  import gluonts.core.settings
  import numpy
  import pandas
  from gluonts.core.component import from_hyperparameters
  from gluonts.dataset.common import Dataset
  from gluonts.dataset.field_names import FieldName
  from gluonts.model.estimator import Estimator
  from gluonts.model.forecast import Forecast, QuantileForecast, SampleForecast
  from gluonts.model.predictor import Predictor
  from pandas.tseries.frequencies import to_offset
  from autogluon.common.loaders import load_pkl
  from autogluon.common.utils.log_utils import set_logger_verbosity
  from autogluon.core.hpo.constants import RAY_BACKEND
  from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP, TimeSeriesDataFrame
  from autogluon.timeseries.models.abstract import AbstractTimeSeriesModel
  from autogluon.timeseries.utils.datetime import norm_freq_str
  from autogluon.timeseries.utils.forecast import get_forecast_horizon_index_ts_dataframe
  from autogluon.timeseries.utils.warning_filters import disable_root_logger, warning_filter
label_desc: Use image node_id 19 for calling the AbstractGluonTSModel obj's underlying member method code with example usage: obj._stack_sample_forecasts(forecasts, item_ids) and returns: pd