class_docstr: TSPipeline is an E2E solution for time series analysis (only forecasting task for now).
  You can use TSPipeline to:
  
  1. Further development on the prototype. (predict, evaluate, incremental fit)
  
  2. Deploy the model to their scenario. (save, load)
docstr: Incremental fitting
  
  :param data: The data support following formats:
  
         | 1. data creator:
         | a function that takes a config dictionary as parameter and
         | returns a PyTorch DataLoader.
         |
         | 2. a bigdl.chronos.data.TSDataset:
         | the TSDataset should follow the same operations as the training
         | TSDataset used in `AutoTSEstimator.fit`.
  
  :param validation_data: validation data, same format as data.
  :param epochs: incremental fitting epoch. The value defaults to 1.
  :param metric: evaluate metric.
  :param batch_size: batch size, defaults to None, which takes the searched best batch_size.
  :param **kwargs: args to be passed to bigdl-nano trainer.
docstr_tok: ["Incremental","fitting",":","param","data",":","The","data","support","following","formats",":","|","1.","data","creator",":","|","a","function","that","takes","a","config","dictionary","as","parameter","and","|","returns","a","PyTorch","DataLoader",".","|","|","2.","a","bigdl.chronos.data.TSDataset",":","|","the","TSDataset","should","follow","the","same","operations","as","the","training","|","TSDataset","used","in","`","AutoTSEstimator.fit","`",".",":","param","validation_data",":","validation","data",",","same","format","as","data",".",":","param","epochs",":","incremental","fitting","epoch",".","The","value","defaults","to","1.",":","param","metric",":","evaluate","metric",".",":","param","batch_size",":","batch","size",",","defaults","to","None",",","which","takes","the","searched","best","batch_size",".",":","param","*","*","kwargs",":","args","to","be","passed","to","bigdl-nano","trainer","."]
code: def fit(
      self,
      data,
      validation_data=None,
      epochs=1,
      batch_size=None,
      **kwargs,
  ):
      """
      Incremental fitting
  
      :param data: The data support following formats:
  
             | 1. data creator:
             | a function that takes a config dictionary as parameter and
             | returns a PyTorch DataLoader.
             |
             | 2. a bigdl.chronos.data.TSDataset:
             | the TSDataset should follow the same operations as the training
             | TSDataset used in `AutoTSEstimator.fit`.
  
      :param validation_data: validation data, same format as data.
      :param epochs: incremental fitting epoch. The value defaults to 1.
      :param metric: evaluate metric.
      :param batch_size: batch size, defaults to None, which takes the searched best batch_size.
      :param **kwargs: args to be passed to bigdl-nano trainer.
      """
      from bigdl.chronos.pytorch import TSTrainer as Trainer
  
      train_loader = None
      valid_loader = None
      if isinstance(data, TSDataset):
          if batch_size is None:
              batch_size = self._best_config["batch_size"]
          train_loader = self._tsdataset_to_loader(
              data, batch_size=batch_size
          )
          if validation_data:
              valid_loader = self._tsdataset_to_loader(
                  validation_data, batch_size=batch_size
              )
      elif isinstance(data, types.FunctionType):
          if batch_size:
              self._best_config.update({"batch_size": batch_size})
          train_loader = data(self._best_config)
          if validation_data:
              valid_loader = validation_data(self._best_config)
      else:
          invalidInputError(
              False,
              "We only support input TSDataset or data creator, "
              f"but found {data.__class__.__name__}.",
          )
  
      self.trainer = Trainer(max_epochs=epochs, **kwargs)
      self.trainer.fit(
          self._best_model,
          train_dataloaders=train_loader,
          val_dataloaders=valid_loader,
      )
  
imports: import os
  from bigdl.chronos.utils import LazyImport
  import types
  import numpy
  from bigdl.chronos.data import TSDataset
  from bigdl.chronos.metric.forecast_metrics import Evaluator
  from bigdl.chronos.pytorch.utils import _pytorch_fashion_inference
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 6 for calling the TSPipeline obj's underlying member method code with example usage: obj.fit(data, validation_data, epochs, batch_size) without return types