class_docstr: Example:
      >>> #The dataset is split into x_train, x_val, x_test, y_train, y_val, y_test
      >>> # 1. Initialize Forecaster directly
      >>> forecaster = LSTMForecaster(past_seq_len=24,
                                      input_feature_num=2,
                                      output_feature_num=2,
                                      ...)
      >>>
      >>> # 2. Initialize Forecaster from from_tsdataset
      >>> forecaster = LSTMForecaster.from_tsdataset(tsdata, **kwargs)
      >>> forecaster.fit(tsdata, epochs=2, ...)
      >>> forecaster.to_local()  # if you set distributed=True
      >>> test_pred = forecaster.predict(x_test)
      >>> test_eval = forecaster.evaluate((x_test, y_test))
      >>> forecaster.save({ckpt_name})
      >>> forecaster.load({ckpt_name})
docstr: Build a LSTM Forecaster Model.
  
  :param tsdataset: Train tsdataset, a bigdl.chronos.data.tsdataset.TSDataset instance.
  :param past_seq_len: Specify the history time steps (i.e. lookback).
         Do not specify the 'past_seq_len' if your tsdataset has called
         the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
  :param kwargs: Specify parameters of Forecaster,
         e.g. loss and optimizer, etc. More info, please refer to
         LSTMForecaster.__init__ methods.
  
  :return: A LSTM Forecaster Model.
docstr_tok: ["Build","a","LSTM","Forecaster","Model",".",":","param","tsdataset",":","Train","tsdataset",",","a","bigdl.chronos.data.tsdataset.TSDataset","instance",".",":","param","past_seq_len",":","Specify","the","history","time","steps","(","i.e",".","lookback",")",".","Do","not","specify","the","'past_seq_len","'","if","your","tsdataset","has","called","the","'TSDataset.roll","'","method","or","'TSDataset.to_torch_data_loader","'",".",":","param","kwargs",":","Specify","parameters","of","Forecaster",",","e.g",".","loss","and","optimizer",",","etc",".","More","info",",","please","refer","to","LSTMForecaster.__init__","methods",".",":","return",":","A","LSTM","Forecaster","Model","."]
code: def from_tsdataset(cls, tsdataset, past_seq_len=None, **kwargs):
      """
      Build a LSTM Forecaster Model.
  
      :param tsdataset: Train tsdataset, a bigdl.chronos.data.tsdataset.TSDataset instance.
      :param past_seq_len: Specify the history time steps (i.e. lookback).
             Do not specify the 'past_seq_len' if your tsdataset has called
             the 'TSDataset.roll' method or 'TSDataset.to_torch_data_loader'.
      :param kwargs: Specify parameters of Forecaster,
             e.g. loss and optimizer, etc. More info, please refer to
             LSTMForecaster.__init__ methods.
  
      :return: A LSTM Forecaster Model.
      """
      from bigdl.chronos.data.tsdataset import TSDataset
      from bigdl.nano.utils.common import invalidInputError
  
      invalidInputError(
          isinstance(tsdataset, TSDataset),
          f"We only supports input a TSDataset, but get{type(tsdataset)}.",
      )
  
      def check_time_steps(tsdataset, past_seq_len):
          if (
              tsdataset.lookback is not None
              and past_seq_len is not None
          ):
              return tsdataset.lookback == past_seq_len
          return True
  
      invalidInputError(
          not tsdataset._has_generate_agg_feature,
          "We will add su`pport for 'gen_rolling_feature' method later.",
      )
  
      if (
          tsdataset.lookback is not None
      ):  # calling roll or to_torch_data_loader
          past_seq_len = tsdataset.lookback
          output_feature_num = len(tsdataset.roll_target)
          input_feature_num = (
              len(tsdataset.roll_feature) + output_feature_num
          )
      elif past_seq_len is not None:  # initialize only
          past_seq_len = (
              past_seq_len
              if isinstance(past_seq_len, int)
              else tsdataset.get_cycle_length()
          )
          output_feature_num = len(tsdataset.target_col)
          input_feature_num = (
              len(tsdataset.feature_col) + output_feature_num
          )
      else:
          invalidInputError(
              False,
              "Forecaster needs 'past_seq_len' to specify "
              "the history time step of training.",
          )
  
      invalidInputError(
          check_time_steps(tsdataset, past_seq_len),
          "tsdataset already has history time steps and "
          "differs from the given past_seq_len "
          f"Expected past_seq_len to be {tsdataset.lookback}, "
          f"but found {past_seq_len}.",
          fixMsg="Do not specify past_seq_len "
          "or call tsdataset.roll method again and specify time step.",
      )
  
      if tsdataset.id_sensitive:
          _id_list_len = len(tsdataset._id_list)
          input_feature_num *= _id_list_len
          output_feature_num *= _id_list_len
  
      return cls(
          past_seq_len=past_seq_len,
          input_feature_num=input_feature_num,
          output_feature_num=output_feature_num,
          **kwargs,
      )
  
imports: import torch
  from bigdl.chronos.forecaster.base_forecaster import BasePytorchForecaster
  from bigdl.chronos.model.VanillaLSTM_pytorch import model_creator, optimizer_creator, loss_creator
label_desc: Use image node_id 2 for calling the LSTMForecaster obj's underlying member method code with example usage: obj.from_tsdataset(cls, tsdataset, past_seq_len) and returns: cls, True, unknown