class_docstr: An estimator that trains an Autogluon Tabular model for time series
  forecasting.
  
  Additional keyword arguments to the constructor, other than the ones documented
  below, will be passed on to Autogluon Tabular's ``fit`` method used for training
  the model.
  
  Parameters
  ----------
  freq
      Frequency of the data to handle
  prediction_length
      Prediction length
  lag_indices
      List of indices of the lagged observations to use as features. If
      None, this will be set automatically based on the frequency.
  time_features
      List of time features to be used. If None, this will be set automatically
      based on the frequency.
  scaling
      Function to be used to scale time series. This should take a pd.Series object
      as input, and return a scaled pd.Series and the scale (float). By default,
      this divides a series by the mean of its absolute value.
  batch_size
      Batch size of the resulting predictor; this is just used at prediction
      time, and does not affect training in any way.
  disable_auto_regression
      Whether to forcefully disable auto-regression in the model. If ``True``,
      this will remove any lag index which is smaller than ``prediction_length``.
      This will make predictions more efficient, but may impact their accuracy.
  quantiles_to_predict
      Whether to forecast in quantile way. If assigned with quantile values,
      this will train model using quantile prediction model. If None, then the model
      will be trained in a regular way.
class_docstr_tok: ["An","estimator","that","trains","an","Autogluon","Tabular","model","for","time","series","forecasting",".","Additional","keyword","arguments","to","the","constructor",",","other","than","the","ones","documented","below",",","will","be","passed","on","to","Autogluon","Tabular","'s","``","fit","``","method","used","for","training","the","model",".","Parameters","--","--","--","--","--","freq","Frequency","of","the","data","to","handle","prediction_length","Prediction","length","lag_indices","List","of","indices","of","the","lagged","observations","to","use","as","features",".","If","None",",","this","will","be","set","automatically","based","on","the","frequency",".","time_features","List","of","time","features","to","be","used",".","If","None",",","this","will","be","set","automatically","based","on","the","frequency",".","scaling","Function","to","be","used","to","scale","time","series",".","This","should","take","a","pd.Series","object","as","input",",","and","return","a","scaled","pd.Series","and","the","scale","(","float",")",".","By","default",",","this","divides","a","series","by","the","mean","of","its","absolute","value",".","batch_size","Batch","size","of","the","resulting","predictor",";","this","is","just","used","at","prediction","time",",","and","does","not","affect","training","in","any","way",".","disable_auto_regression","Whether","to","forcefully","disable","auto-regression","in","the","model",".","If","``","True","``",",","this","will","remove","any","lag","index","which","is","smaller","than","``","prediction_length","``",".","This","will","make","predictions","more","efficient",",","but","may","impact","their","accuracy",".","quantiles_to_predict","Whether","to","forecast","in","quantile","way",".","If","assigned","with","quantile","values",",","this","will","train","model","using","quantile","prediction","model",".","If","None",",","then","the","model","will","be","trained","in","a","regular","way","."]
code: def train(
      self,
      training_data: Dataset,
      validation_data: Optional[Dataset] = None,
  ) -> TabularPredictor:
      kwargs_override = {}
  
      dfs = [
          get_features_dataframe(
              series=self.scaling(to_pandas(entry))[0],
              time_features=self.time_features,
              lag_indices=self.lag_indices,
          )
          for entry in training_data
      ]
  
      if validation_data is not None or self.last_k_for_val is not None:
          kwargs_override["auto_stack"] = False
          logger.warning(
              "Auto Stacking is turned off as validation dataset is provided"
              " before input into Tabular Predictor."
          )
  
      if validation_data is not None:
          logger.log(20, "Validation dataset is directly provided.")
          validation_dfs = [
              get_features_dataframe(
                  series=self.scaling(to_pandas(entry))[0],
                  time_features=self.time_features,
                  lag_indices=self.lag_indices,
              )
              for entry in validation_data
          ]
          train_df = pd.concat(dfs)
          val_df = pd.concat(validation_dfs)
      elif self.last_k_for_val is not None:
          logger.log(
              20,
              "last_k_for_val is provided, choosing last"
              f" {self.last_k_for_val} of each time series as validation"
              " set.",
          )
          train_dfs = [
              tmp_df.iloc[: -self.last_k_for_val, :] for tmp_df in dfs
          ]
          validation_dfs = [
              tmp_df.iloc[-self.last_k_for_val :, :] for tmp_df in dfs
          ]
          train_df = pd.concat(train_dfs)
          val_df = pd.concat(validation_dfs)
      else:
          logger.log(
              20,
              "No validation dataset is provided, will let TabularPredictor"
              " do the splitting automatically,Note that this might break"
              " the time order of time series data.",
          )
          train_df = pd.concat(dfs)
          val_df = None
  
      if self.quantiles_to_predict is not None:
          ag_model = AutogluonTabularPredictor(
              label="target",
              problem_type="quantile",
              quantile_levels=self.quantiles_to_predict,
          ).fit(
              train_df,
              tuning_data=val_df,
              **{**self.kwargs, **kwargs_override},
          )
      else:
          ag_model = AutogluonTabularPredictor(
              label="target",
              problem_type="regression",
              eval_metric=self.eval_metric,
          ).fit(
              train_df,
              tuning_data=val_df,
              **{**self.kwargs, **kwargs_override},
          )
  
      return TabularPredictor(
          ag_model=ag_model,
          prediction_length=self.prediction_length,
          time_features=self.time_features,
          lag_indices=self.lag_indices,
          scaling=self.scaling,
          batch_size=self.batch_size,
          quantiles_to_predict=self.quantiles_to_predict,
      )
  
file_path: gluonts/src/gluonts/nursery/autogluon_tabular/estimator.py
imports: import logging
  from typing import Callable, Optional, List, Tuple
  import pandas
  from autogluon.tabular import TabularPredictor
  from gluonts.core.component import validated
  from gluonts.dataset.common import Dataset
  from gluonts.dataset.util import to_pandas
  from gluonts.model.estimator import Estimator
  from gluonts.time_feature import TimeFeature, get_lags_for_frequency, time_features_from_frequency_str
  from .predictor import TabularPredictor, mean_abs_scaling, get_features_dataframe
label_desc: Use image node_id 2 for calling the TabularEstimator obj's underlying member method code with example usage: obj.train(training_data, validation_data) and returns: TabularPredictor