You are here

time series prediction with multiple input data

Dear Jeff,
Dear Forum,

I'm using Encog (Java) for my bachelor thesis (and hopefully, if everything works out as I hope it will, we'll use it in our productive system to improve our predictions).

Even though I bought and read your excellent book, I can't figure out how to construct training data from 2d arrays and feed them to the network. The only information I found here in the forum is that currently there is no example with 2d arrays...

So could someone point me in the right direction with the following setting?!

- I have a daily time series value t, which I want to predict
- but t depends not only on time, but also on 3 other values (x, y, z)

If it wasn't a time series prediction I would simply train the network with any number of [ti, xi, yi, zi] datasets. But since t depends on time, I would want to train the network with something like this:

WINDOW_SIZE = 3 (unrealistic small number, just to make it easy here ;-)
1. training dataset:
[ti, xi, yi, zi]
[ti+1, xi+1, yi+1, zi+1]
[ti+2, xi+2, yi+2, zi+2]
], ti+3
2. training dataset:
[ti+3, xi+3, yi+3, zi+3]
[ti+4, xi+4, yi+4, zi+4]
[ti+5, xi+5, yi+5, zi+5]
], ti+6

Is there a way to do that?
I tried to do it with a TemporalWindowArray, since it has an analyze() method that takes a 2d array, but then I got stuck as I needed to call the process() method, which doesn't handle 2d arrays...

Any help is much appreciated!
Thank you in advance!


Neural Network Forums: 
surak's picture


go and download the development branch from GIT, a lot have happened in Encog since the 3.1 version.


jeffheaton's picture

You can use the Encog Analyst, which supports multiple inputs. It can be used from either the workbench or direct from code.

This article is ninjatrader focused, but it does show how to use multiple inputs in Encog analyst.

Direct from code, you can use the class. This supports either a 1d array (single input) or 2d (multiple input).


Bianca Ott's picture

Thank you for your answers!

But as I said in my original post, I couldn't make it work using TemporalWindowArray. I'll get the newest release from git and see if things have changed in that particular area. Because as soon as I'm not dealing with time series predictions anymore, my current solution will probably not work anymore.

The current solution is:
- building TemporalMLDataSet(s)
- adding TemporalDataDescription(s) and TemporalPoint(s)
- train the network with these

So I'll stay on that path for a while and try to make it work, but if anyone has further suggestions, please let me know!!!

As I will have to do a lot of experimenting and run/train the networks with MANY different settings, parameters and data set sizes, I'm only interested in using encog from code - even though I liked the workbench a lot :-)

Thank you!

albertjosua's picture

What subject your thesis?
I'm using the Encog Java for predict time series hidrological.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer