Difference in initial predicition for LSTM Training matlab

16 次查看(过去 30 天)
I have done timeseries training with LSTM in matlab. Once i am doing prediction for data apart from training i am observing difference in initial timestep then its matching quite well with actual test data. Is there any way to improve it?
Dataset has two input and one output. i have normalised dataset and havent considered time as feature in the dataset.

回答(1 个)

Ayush
Ayush 2025-12-9,8:14
Hi Ranjith,
I understand you’re seeing a mismatch at the initial timestep when using your trained LSTM for prediction, but the model aligns well with actual test data after that.
You can try the following recommendations to improve the initial prediction:
  1. State Initialization: Before making predictions on new data, try updating the LSTM’s state using a short “warm-up” sequence from your test data. In MATLAB, you can use the predictAndUpdateState function with a few initial timesteps before starting your actual prediction.
  2. Try Including Time as a Feature: If there are trends or seasonality, adding a time or sequence index as an input feature can help the model with initial predictions.
  3. Expand Training Data: Include more varied starting points or sequences in your training set so the model can generalize better to unseen initial conditions.
You can refer to the following documentation to know more about "predictAndUpdateState" function:
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by