Skip to main content

Time series

Long Short-Term Memory (LSTM) forecasting is designed to predict future values in a sequence by "remembering" important information over long periods. It can be used to detect repetitive patterns such as daily cycles where values depend on the hour of day.

Dataset

Create a new dataset and select mode LSTM. Click on Parameters and optionally modify one or more parameters. The training is implemented with a Tensorflow neural network.

ParameterValueDefault
WindowNumber of data points in a sample8
HorizonNumber of future time steps to predict1
UnitsNumber of neurons in a layer20
EpochsNumber of cycles for training50
Learning rateStep size for each iteration0.01
LayersNumber of layers in the neural network1

If your dataset includes a value for every hour, and you want to capture the daily pattern the window should be set to '24'. By increasing the number of units and layers you can capture more complex patterns, but training takes longer, and you should increase the number of epochs. Click on Train to train the model on the dataset. This may take a few minutes.

The predicted values are displayed in red together with the actual values in blue. The accuracy is calculated by the comparing the predicted and actual values. Click on Forecast to make predictions until the end time defined in the dataset. The predictions are calculated by predicting one data point at a time based on the previous sequence. A limitation of this approach is that the accuracy declines rapidly for data in the future because new predicted values are based on previous predictions. The LSTM mode is very useful to predict the next few data points for irregular patterns but is not suitable for long term predictions.