Making time series predictions based on a keras model

Hello KNIME community,
I have constructed a simple LSTM model in KNIME using the Keras extension and wish to make a prediction into the future based on this model. I have searched around the web to no avail and it doesn’t seem like its an easy fix (although that would be much appreciated). I, therefore, post here to see if I could get a possible solution to this problem. After all, what is the purpose of having a Keras model if you cant use it to make predictions?

Hi @Repletion and welcome to the forum.

Have you looked on the KNIME Hub yet? In particular, you may want to check the two Keras workflows listed in the link below - one for training, one for deployment.

In particular, these are making use of the Keras Network Writer, Keras Network Reader, and Keras Network Executor nodes.

Hope that helps!

Correct me if I am wrong, but this workflow utilizes build in predictor nodes such as the random forest. Keras does not have such a node, hence why I am asking about a possible solution.

Sorry, I should have been more clear when I linked the workflow group. Take a look at 03 and 04 in the group linked above - Those are the Keras specific workflows.

1 Like

Hi @Repletion,

to apply your trained network to new data you can use the Keras Network Executor node.

Are you planning to predict only the next value in your time series? Or do you want to use the next predicted value as input to predict also the next value and so on?

There are couple examples for how to deploy LSTM networks with KNIME Analytics Platform based on text. But in the end text is also a sequence of characters. Therefore they might be helpful.

A many-to-many example (training and deployment)

A many-to-one example (training and deployment)

Cheers
Kathrin

Thank you and @ScottF for the replies. I will have a look for sure, but I have one last question. Wouldnt it be possible to predict future values if you train only on lagged values? For example if all your training columns are lagged by 1 and the responsevariable is not lagged, wouldnt that mean you could predict future values by doing so?

The one problem I have with that approach is that it makes my Keras model accuracy constant 0 with the same parameters as before (where it worked without the lagged values). I have posted in more detail about it here: Keras model accuracy constant 0