class_docstr: Example:
      >>> #The dataset is split into x_train, x_val, x_test, y_train, y_val, y_test
      >>> forecaster = LSTMForecaster(past_seq_len=24,
                                      input_feature_num=2,
                                      output_feature_num=2,
                                      ...)
      >>> forecaster.fit((x_train, y_train))
      >>> test_pred = forecaster.predict(x_test)
      >>> test_eval = forecaster.evaluate((x_test, y_test))
      >>> forecaster.save({ckpt_dir_name})
      >>> forecaster.load({ckpt_dir_name})
class_docstr_tok: ["Example",":",">",">",">","#","The","dataset","is","split","into","x_train",",","x_val",",","x_test",",","y_train",",","y_val",",","y_test",">",">",">","forecaster","=","LSTMForecaster","(","past_seq_len=24",",","input_feature_num=2",",","output_feature_num=2",",","...",")",">",">",">","forecaster.fit","(","(","x_train",",","y_train",")",")",">",">",">","test_pred","=","forecaster.predict","(","x_test",")",">",">",">","test_eval","=","forecaster.evaluate","(","(","x_test",",","y_test",")",")",">",">",">","forecaster.save","(","{","ckpt_dir_name","}",")",">",">",">","forecaster.load","(","{","ckpt_dir_name","}",")"]
docstr: Build a LSTMForecaster Model
  
  :param tsdataset: A bigdl.chronos.data.tsdataset.TSDataset instance.
  :param past_seq_len: 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_tf_dataset'.
  :param kwargs: Specify parameters of Forecaster,
         e.g. loss and optimizer, etc. More info, please refer to
         LSTMForecaster.__init__ methods.
  
  :return: A LSTMForecaster Model
docstr_tok: ["Build","a","LSTMForecaster","Model",":","param","tsdataset",":","A","bigdl.chronos.data.tsdataset.TSDataset","instance",".",":","param","past_seq_len",":","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_tf_dataset","'",".",":","param","kwargs",":","Specify","parameters","of","Forecaster",",","e.g",".","loss","and","optimizer",",","etc",".","More","info",",","please","refer","to","LSTMForecaster.__init__","methods",".",":","return",":","A","LSTMForecaster","Model"]
code: def from_tsdataset(cls, tsdataset, past_seq_len=None, **kwargs):
      """
      Build a LSTMForecaster Model
  
      :param tsdataset: A bigdl.chronos.data.tsdataset.TSDataset instance.
      :param past_seq_len: 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_tf_dataset'.
      :param kwargs: Specify parameters of Forecaster,
             e.g. loss and optimizer, etc. More info, please refer to
             LSTMForecaster.__init__ methods.
  
      :return: A LSTMForecaster Model
      """
      from bigdl.nano.utils.common import invalidInputError
  
      def check_time_steps(tsdataset, past_seq_len):
          if tsdataset.lookback and past_seq_len:
              return tsdataset.lookback == past_seq_len
          return True
  
      invalidInputError(
          not tsdataset._has_generate_agg_feature,
          "We will add support for 'gen_rolling_feature' method later.",
      )
  
      if tsdataset.lookback:
          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:
          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.",
      )
  
      return cls(
          past_seq_len=past_seq_len,
          input_feature_num=input_feature_num,
          output_feature_num=output_feature_num,
          **kwargs,
      )
  
imports: from bigdl.chronos.forecaster.tf.base_forecaster import BaseTF2Forecaster
  from bigdl.chronos.model.tf2.VanillaLSTM_keras import model_creator, LSTMModel
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