0
$\begingroup$

A multivariate time-serie has more than one time-dependent variable and it is my case.

Still for each time I have not one entrie of dependent variables but many entries, like:

+======================================================================================================================================================================================+
| index, target, feature1, feature2, feature3, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature11, feature12, feature13, feature14, feature15, feature16 |
+======================================================================================================================================================================================+
| 2013-01-01, 1, 12, 0.006750, 21.192372, 39.119279, 0, 0, 0, 0, 13.602740, 117691.0, 0.06, 17259.0, 61491.0, 10.960000, 44620.0,                                                      |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2013-01-01, 1, 12, 0.256899, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 835.0, 0.06, 221.0, 344.0, 10.004412, 406.0,                                                               |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 2013-01-01, 0, 12, 0.000500, 21.192372, 39.119279, 0, 0, 0, 0, 30.282192, 49292.0, 0.04, 10853.0, 22945.0, 10.004412, 20132.0,                                                       |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

I was trying to follow this approach applying LSTM, to give it a try, I res-sampled data by month, taking the average for each group. But this is far from reality and is a biased data especially when predicting target (binary).

Another thing to mention, my motivation of trying to learn from time, is that I have the impression it affects a lot other features, and thus, I can assume it have an unignorable influence on target.

Applying train_dated[['feature1']].resample('M').mean() on each of columns; shows trends and seasonality.

This is an example applying decomposition on one feature:

enter image description here

$\endgroup$
0
$\begingroup$

I had such a problem earlier and that what I did is to separate the date to year, month and day. I used logistic regression. For my side, it was helpful and the test percentage was 77%.

| improve this answer | |
$\endgroup$
0
$\begingroup$

What you need is a multi-index (aka hierarchical) dataframe. This way you can properly arrange certain features into indices according to their timestamp. As it happens, I wrote a small piece on that, which you can use as an example (see the linked github for code)

| improve this answer | |
$\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.