Reputation: 59
if i wanted to train an lstm to predict the next date in a sequence of dates, how would i do that since lstm require a scaled value?
example of data:
date | next date |
---|---|
2012-05-12 | 2012-05-13 |
2012-05-13 | 2012-05-19 |
2012-05-19 | 2012-05-20 |
2012-05-20 | 2012-05-22 |
2012-05-22 | 2012-05-26 |
2012-05-26 | 2012-05-27 |
2012-05-27 | 2012-05-30 |
2012-05-30 | 2012-06-12 |
2012-06-12 | 2012-05-19 |
2012-06-19 | 2012-06-25 |
Upvotes: 2
Views: 1069
Reputation: 10406
You could hand over the date split into three inputs: One would then be the year, the other the month, and the last the day. While normalizing your inputs definitely makes sense, however I would not entirely agree with your "LSTM requires".
Day and month are already limited to a range of values which can be scaled
For year you need to make an educated assumption based on your application. So that year can then also be transferred to a scaled value. Judging from your data, it might be that year is constant at 2012 and it is not needed to begin with.
Note: Ask yourself whether you give the neural network enough system information to be able to predict the next date - meaning, is there already enough of a pattern in your data? Otherwise you might end up training a random predictor.
Upvotes: 2