简体   繁体   中英

Multiple multivariate time series classification with(?) LSTM

I am relatively new to time-series classification and am looking for some help:

I have a dataset with 5000 multivariate time series each consisting of 21 variables, a time period of 3 years, and the class information of either 1 or 0. What I want to do is to classify a new input consisting itself of 21 variables over a time period of 3 years.

As for now after a couple of days of research, I have not found (or obviously not understood) a way to feed multiple multivariate time series into an LSTM. Is there a possible solution at all?

My current idea is to "merge" the 5000 time series into one and add another individual variable to each that distinguishes every section explicitly...I am absolutely not sure if this works or is utterly stupid...

I am happy for any help or hints!!! If I need to further clarify anything pls ask and I will do so immediately!

I am building a similar model but for images. In your case, let's assume your data is structured like this:

0000: x1, x2, x3....x21
0001: x1, x2, x3....x21
0002: x1, x2, x3....x21
.
.
.
5000: x1, x2, x3....x21

If you want to predict results with an input of just one observation (that is, time step of 1), construct the dataset such that the next step of time series is current step's output. Here the variables after the arrow mark are your target variables.

0000: x1, x2, x3 ....x21 ->> 0001: x1, x2, x3 .... x21
0001: x1, x2, x3 ....x21 ->> 0002: x1, x2, x3 .... x21
0002: x1, x2, x3 ....x21 ->> 0003: x1, x2, x3 .... x21
.
.
.
4999: x1, x2, x3 ....x21 ->> 5000: x1, x2, x3 .... x21

If you want to have multiple time steps as input, let's say, 3, then the 4th time step will be your target variable for the first time steps and so on:

[0000: x1, x2, x3....x21
0001: x1, x2, x3....x21
0002: x1, x2, x3....x21] ->> [0003: x1,x2,x3 .... x21]
[0001: x1, x2, x3....x21
0002: x1, x2, x3....x21
0003: x1, x2, x3....x21] ->> [0004: x1,x2,x3 .... x21]
.
.
.
[4997: x1, x2, x3....x21
4998: x1, x2, x3....x21
4999: x1, x2, x3....x21] ->> [5000: x1,x2,x3 .... x21]

So the important part is defining the dataset properly and LSTM works nicely with such data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM