Forecasting sales using linear regression on time series

Hello Knime community!

I’m looking for a way to forecast sales with a regression algorithm. I’ve found this workflow 02_Example_for_Predicting_Time_Series.knwf (2.4 MB) as a base (since my data are constructed more or less the same way) to built my own.

But there’s a thing that I do not understand, the Regression predictor node is proposing a forecast that is comparable to past sales (very usefull to calculate the RMSE and other KPIs) however I cannot find the way to generate a future forecast…

Any one has a lead on how to proceed?

Regards,

Hi @crnico, apologies for the slow response!

Unfortunately the linear regression nodes in KNIME don’t have the ability to output a series of values to create a forecast in the way you seem to be looking for. In effect it’s a single value numeric predictor.

A way you could work around this is with a recursive loop, predicting the next value and recursively using that value to predict the next one. I realize that can be a bit of a pain to need to build but we’re working on making forecasting more robust in KNIME.

That loop may look something like this:

Alternatively we do have components for training and deploying ARIMA models that do support forecasting without the need for a loop. If you used an ARIMA with AR = 10 and all other values = 0 you’d be working with roughly same type of model as in your workflow. However removing some of those daily patterns would likely be helpful (we also have some components to help with that).
Here’s an example of that in your workflow, however you’ll see that this approach doesn’t hold up well in the forecast(same issue would occur with the linear regression approach):


Here’s an example workflow that goes through the entire process with the ARIMA approach that may be interesting as well:

Also, here’s your workflow with the ARIMA components from the screenshots:
02_Example_for_Predicting_Time_Series.knwf.knwf (2.6 MB)

3 Likes

Hello Corey,
Thanks for reply, both solution seems to be really interessting.
However, I’d like to better understand the first one you mention (the one with the printscreen within wich I can see the Tensor Flow)
Could you give me an example of .knwf file which I can manipulate?

Regards,

Here’s the workflow that used the recursive loop to generate a forecast. It uses an LSTM network that will require that the python and deep learning integration be set up with KNIME, but should give you an idea of what the loop would look like.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.