code: def test_forecaster_fit_val_from_tsdataset(self):
      train, val, test = create_tsdataset_val()
      lstm = LSTMForecaster.from_tsdataset(
          train, hidden_dim=16, layer_num=2
      )
      lstm.fit(train, val, epochs=2, batch_size=32)
      yhat = lstm.predict(test, batch_size=32, acceleration=False)
      test.roll(
          lookback=lstm.data_config["past_seq_len"],
          horizon=lstm.data_config["future_seq_len"],
      )
      _, y_test = test.to_numpy()
      assert yhat.shape == y_test.shape
  
      del lstm
      train, val, test = create_tsdataset_val(
          roll=False, horizon=[1, 3, 5]
      )
      lstm = LSTMForecaster.from_tsdataset(
          train, past_seq_len=24, hidden_dim=16, layer_num=2
      )
      lstm.fit(train, val, epochs=2, batch_size=32)
      yhat = lstm.predict(test, batch_size=None, acceleration=False)
      test.roll(
          lookback=lstm.data_config["past_seq_len"],
          horizon=lstm.data_config["future_seq_len"],
      )
      _, y_test = test.to_numpy()
      assert yhat.shape == y_test.shape
  
imports: import numpy
  import tempfile
  import os
  from bigdl.chronos.utils import LazyImport
  from unittest import TestCase
  import pytest
  from ..None import op_torch, op_distributed, op_inference, op_automl
label_desc: Use image node_id 29 for calling the TestChronosModelLSTMForecaster obj's underlying member method code with example usage: obj.test_forecaster_fit_val_from_tsdataset() without return types