code: def test_tabular_estimator(
      dataset,
      freq,
      prediction_length: int,
      lag_indices: List[int],
      disable_auto_regression: bool,
      last_k_for_val: int,
      validation_data: ListDataset,
  ):
      estimator = TabularEstimator(
          freq=freq,
          prediction_length=prediction_length,
          lag_indices=lag_indices,
          time_limit=10,
          disable_auto_regression=disable_auto_regression,
          last_k_for_val=last_k_for_val,
      )
  
      def check_consistency(entry, f1, f2):
          ts = to_pandas(entry)
          start_timestamp = ts.index[-1] + 1
          assert f1.samples.shape == (1, prediction_length)
          assert f1.start_date == start_timestamp
          assert f2.samples.shape == (1, prediction_length)
          assert f2.start_date == start_timestamp
          assert np.allclose(f1.samples, f2.samples)
  
      with tempfile.TemporaryDirectory() as path:
          predictor = estimator.train(
              dataset, validation_data=validation_data
          )
          predictor.serialize(Path(path))
          predictor = None
          predictor = Predictor.deserialize(Path(path))
          assert not predictor.auto_regression or any(
              l < prediction_length for l in predictor.lag_indices
          )
  
          assert predictor.batch_size > 1
  
          forecasts_serial = list(predictor._predict_serial(dataset))
          forecasts_batch = list(predictor.predict(dataset))
  
          for entry, f1, f2 in zip(
              dataset, forecasts_serial, forecasts_batch
          ):
              check_consistency(entry, f1, f2)
  
          if not predictor.auto_regression:
              forecasts_batch_autoreg = list(
                  predictor._predict_batch_autoreg(dataset)
              )
              for entry, f1, f2 in zip(
                  dataset, forecasts_serial, forecasts_batch_autoreg
              ):
                  check_consistency(entry, f1, f2)
  
file_path: gluonts/test/nursery/autogluon_tabular/test_autogluon_tabular.py
imports: from typing import List, Optional
  import pytest
  import numpy
  import pandas
  import tempfile
  from pathlib import Path
  from gluonts.dataset.common import ListDataset
  from gluonts.dataset.util import to_pandas
  from gluonts.nursery.autogluon_tabular.predictor import get_features_dataframe
  from gluonts.nursery.autogluon_tabular import TabularEstimator
  from gluonts.model.predictor import Predictor
  from gluonts.time_feature import TimeFeature, hour_of_day, day_of_week, month_of_year
label_desc: Use image node_id 2 for calling a global function with example usage: test_tabular_estimator(dataset, freq, prediction_length, lag_indices, disable_auto_regression, last_k_for_val, validation_data) without return types