code: def _predict_serial(
      self, dataset: Iterable[Dict], **kwargs
  ) -> Iterator[Forecast]:
      for entry in dataset:
          series, scale = self.scaling(to_pandas(entry))
  
          forecast_index = pd.period_range(
              series.index[-1] + 1,
              periods=self.prediction_length,
              freq=series.index[-1].freq,
          )
  
          forecast_series = pd.Series(
              [None] * len(forecast_index),
              index=forecast_index,
          )
  
          full_series = series.append(forecast_series)
  
          if not self.auto_regression:  # predict all at once
              df = get_features_dataframe(
                  forecast_series,
                  time_features=self.time_features,
                  lag_indices=self.lag_indices,
                  past_data=series,
              )
              full_series[
                  forecast_series.index
              ] = self.ag_model.predict(df)
  
          else:  # predict step by step
              for idx in forecast_series.index:
                  df = get_features_dataframe(
                      forecast_series[idx:idx],
                      time_features=self.time_features,
                      lag_indices=self.lag_indices,
                      past_data=full_series[:idx][:-1],
                  )
                  full_series[idx] = self.ag_model.predict(df).item()
  
          yield self._to_forecast(
              scale
              * full_series[forecast_index].values.astype(self.dtype),
              forecast_index[0],
              item_id=entry.get(FieldName.ITEM_ID, None),
          )
  
imports: from typing import Callable, Dict, List, Optional, Iterator, Iterable, Tuple
  import numpy
  import pandas
  import shutil
  from pathlib import Path
  from autogluon.tabular import TabularPredictor
  from gluonts.core.serde import dump_json, load_json
  from gluonts.dataset.util import to_pandas
  from gluonts.dataset.field_names import FieldName
  from gluonts.itertools import batcher
  from gluonts.model.forecast import SampleForecast, QuantileForecast, Forecast
  from gluonts.model.predictor import Predictor
  from gluonts.time_feature import TimeFeature
label_desc: Use image node_id 4 for calling the TabularPredictor obj's underlying member method code with example usage: obj._predict_serial(dataset) without return types