class_docstr: Time Sequence Model integrates feature transformation model selection for time series
  forecasting.
  It has similar functionality with the TimeSequencePipeline.
  Note that to be compatible with load_ts_pipeline in TimeSequencePipeline,
  TimeSequenceModel should be able to restore with TimeSequenceModel().restore(checkpoint).
  TimeSequenceModel could be optimized if we deprecate load_ts_pipeline
   in future version.
class_docstr_tok: ["Time","Sequence","Model","integrates","feature","transformation","model","selection","for","time","series","forecasting",".","It","has","similar","functionality","with","the","TimeSequencePipeline",".","Note","that","to","be","compatible","with","load_ts_pipeline","in","TimeSequencePipeline",",","TimeSequenceModel","should","be","able","to","restore","with","TimeSequenceModel","(",")",".restore","(","checkpoint",")",".","TimeSequenceModel","could","be","optimized","if","we","deprecate","load_ts_pipeline","in","future","version","."]
code: def _process_data(self, data, mode="test"):
      df = deepcopy(data)
      imputer = None
      config = self.config.copy()
      if "imputation" in config:
          if config["imputation"] == "LastFillImpute":
              imputer = LastFillImpute()
          elif config["imputation"] == "FillZeroImpute":
              imputer = FillZeroImpute()
      if imputer:
          df = imputer.impute(df)
  
      if mode == "train":
          data_np = self.ft.fit_transform(df, **config)
      elif mode == "val":
          data_np = self.ft.transform(df, is_train=True)
      elif mode == "test":
          x, _ = self.ft.transform(df, is_train=False)
          data_np = x
      else:
          raise ValueError(
              f"Mode should be among ['train', 'val', 'test']. Got {mode}"
          )
      return data_np
  
imports: from copy import deepcopy
  from zoo.orca.automl.model.abstract import BaseModel, ModelBuilder
  from zoo.chronos.model.VanillaLSTM import VanillaLSTM
  from zoo.chronos.model.Seq2Seq import LSTMSeq2Seq
  from zoo.chronos.model.MTNet_keras import MTNetKeras
  from zoo.chronos.autots.deprecated.feature.utils import save_config
  from zoo.chronos.autots.deprecated.feature.time_sequence import TimeSequenceFeatureTransformer
  from zoo.chronos.autots.deprecated.preprocessing.impute import LastFillImpute, FillZeroImpute
  from zoo.chronos.utils import deprecated
  from zoo.orca.automl.metrics import Evaluator
  import pandas
  import os
  import tempfile
  import shutil
  import zipfile
  import json
label_desc: Use image node_id 4 for calling the TimeSequenceModel obj's underlying member method code with example usage: obj._process_data(data, mode) and returns: data_np