docstr: Fits the model. 
docstr_tok: ["Fits","the","model","."]
code: def fit(self, train_data: EncodedDs, dev_data: EncodedDs) -> None:
      """Fits the model."""  # noqa
      log.info("Started fitting GluonTS forecasting model")
  
      # prepare data
      cat_ds = ConcatedEncodedDs([train_data, dev_data])
      for col in self.static_features_cat:
          self.static_features_cat_encoders[col] = OrdinalEncoder().fit(
              cat_ds.data_frame[col].values.reshape(-1, 1)
          )
  
      fit_groups = (
          list(cat_ds.data_frame[self.grouped_by[0]].unique())
          if self.grouped_by != ["__default"]
          else None
      )
      train_ds = self._make_initial_ds(
          cat_ds.data_frame, phase="train", groups=fit_groups
      )
      batch_size = 32
      self.model_train_stats = TrainingHistory()
  
      self.estimator = DeepAREstimator(
          freq=train_ds.freq,
          prediction_length=self.horizon,
          distr_output=self.distribution,
          lags_seq=[i + 1 for i in range(self.window)],
          batch_size=batch_size,
          use_feat_static_cat=True
          if self.static_features_cat
          else False,
          use_feat_static_real=True
          if self.static_features_real
          else False,
          trainer=Trainer(
              epochs=self.n_epochs,
              num_batches_per_epoch=max(
                  1, len(cat_ds.data_frame) // batch_size
              ),
              callbacks=[
                  EarlyStop(patience=self.patience),
                  self.model_train_stats,
              ],
          ),
      )
      self.model = self.estimator.train(train_ds)
      self.prepared = True
      log.info("Successfully trained GluonTS forecasting model.")
  
imports: import importlib
  from copy import deepcopy
  from typing import Dict, Union, Optional, List
  import numpy
  import pandas
  import mxnet
  from sklearn.preprocessing import OrdinalEncoder
  from gluonts.dataset.pandas import PandasDataset
  from gluonts.mx import DeepAREstimator, Trainer
  from gluonts.mx.trainer.callback import TrainingHistory
  from gluonts.mx.distribution.student_t import StudentTOutput
  from lightwood.helpers.log import log
  from lightwood.mixer.base import BaseMixer
  from lightwood.api.types import PredictionArguments
  from lightwood.data.encoded_ds import EncodedDs, ConcatedEncodedDs
label_desc: Use image node_id 2 for calling the GluonTSMixer obj's underlying member method code with example usage: obj.fit(train_data, dev_data) without return types