0
$\begingroup$

I have a labelled dataset (0 and 1) with two types of short length time series data (from day1-day5) as follows.

Type1 (Temperature at location1):

sensor1, 38, 38, 35, 33, 32
sensor2, 33, 32, 35, 36, 32
and so on ....

Type2 (Temperature at location2):

sensor1, 18, 18, 12, 11, 09
sensor2, 13, 12, 15, 16, 12
and so on ....

In summary my dataset looks as follows.

ID, time-series1, time-series2, label
sensor1, [38, 38, 35, 33, 32], [18, 18, 12, 11, 09], 0
sensor2, [33, 32, 35, 36, 32], [13, 12, 15, 16, 12], 1
and so on ....

I would like to use my dataset in LSTM (or a equivalent deep learning model).

However, I am still not clear how I can use my dataset in a deep learning model such as LSTM.

I am happy to provide more details if needed.

$\endgroup$
4
  • 1
    $\begingroup$ Are you sure you want an autoencoder if you have labels? Do you not want to predict the label? $\endgroup$ – timchap Jul 16 '19 at 9:03
  • $\begingroup$ @timchap Thank you for the comment. My knowledge about deep learning is very low. I thought autoencoder would work. if it is not suitable for my problem, I am happy to recieve and accept answers in other deep learning models that suits my problem. Please let me know your thoughts :) $\endgroup$ – EmJ Jul 16 '19 at 10:25
  • 1
    $\begingroup$ The goal of an autoencoder is to learn how to "compress" (encode) some data to some latent representation and subsequently reproduce the original data (decode) from that compressed form. An LSTM autoencoder applies this technique to sequence data. You probably want an "LSTM classifier" (try searching this term instead), whose goal typically is: given a sequence, predict the target value. I think that is closer to what you what you are looking for. $\endgroup$ – timchap Jul 16 '19 at 10:48
  • 1
    $\begingroup$ @timchap thank you. I have edited the question accordingly. I will search in google too. thank you :) $\endgroup$ – EmJ Jul 16 '19 at 11:42
1
$\begingroup$

RNN input data must follow this pattern:

( Number of observations , Number of input series , Window size )

Keep the number of observations to None when you define the LSTM input_shape. The number of input series in this case is 2, since you are using two time series to make predictions. Window size is the length of your time series row. Your input shape would then be:

input_shape = (2, window_size)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.