【问题标题】:Train/test set split for LSTM with multivariate Time series具有多变量时间序列的 LSTM 的训练/测试集拆分
【发布时间】:2019-05-18 23:57:36
【问题描述】:

我正在尝试使用 LSTM 方法解决 Python 中多变量数据的时间序列预测问题。

here,作者解决时间序列空气污染预测问题。数据如下所示:

                    pollution  dew  temp   press wnd_dir  wnd_spd  snow  rain
date
2010-01-02 00:00:00      129.0  -16  -4.0  1020.0      SE     1.79     0     0
2010-01-02 01:00:00      148.0  -15  -4.0  1020.0      SE     2.68     0     0
2010-01-02 02:00:00      159.0  -11  -5.0  1021.0      SE     3.57     0     0
2010-01-02 03:00:00      181.0   -7  -5.0  1022.0      SE     5.36     1     0
2010-01-02 04:00:00      138.0   -7  -5.0  1022.0      SE     6.25     2     0 

与上述教程中的每年相比,我对足球比赛进行了 30 秒的时间步长观察,其中包含 20 多个特征。其中每个具有唯一 ID 的匹配具有不同的长度,范围从 190 到 200。

作者按一年中的天数拆分训练/测试集如下:

# split into train and test sets
values = reframed.values
n_train_hours = 365 * 24
train = values[:n_train_hours, :]
test = values[n_train_hours:, :]

所以我的训练/测试集应该是匹配的数量: (匹配*len(匹配))

n_train_matches = some k number of matches * len(match)
train = values[:n_train_matches, :]
test = values[n_train_matches:, :]

我想将其转化为我的问题,以便最早在时间 t=2 时对每个特征进行预测。 IE。 30 秒进入比赛。

问题

我是否需要在每场比赛中应用 pre-Sequence Padding?

有没有办法解决这个问题而不用填充?

【问题讨论】:

    标签: keras sequence padding lstm recurrent-neural-network


    【解决方案1】:

    如果您使用的是 LSTM,那么如果您在多个 30 秒的步骤中进行填充和输入,我相信您更有可能从该模型中受益。

    如果您没有填充序列,并且想要在 t=2 时进行预测,那么您将只能使用最后一步观察。

    【讨论】:

      猜你喜欢
      • 2021-01-14
      • 2022-01-21
      • 1970-01-01
      • 2019-05-10
      • 2020-01-30
      • 1970-01-01
      • 2017-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多