【问题标题】:What is the input shape for LSTM from the data?数据中 LSTM 的输入形状是什么?
【发布时间】:2019-10-19 20:05:12
【问题描述】:

我有用户位置数据集,需要根据之前的数据预测用户的下一个位置。我选择使用 lstm 进行预测,但坚持塑造数据。

lstm 数据的输入形状应该是什么?

Total number of rows: 53398560
Total number of columns: 4

Columns: User, Timestamp, slot, Location

Users count: 111247
slot : [0-95] Each slot is the 15 mins of the timestamp.
     2014-01-18 00:00:00 ----- 0
     2014-01-18 23:45:00 ----- 95
No of timestamps for each user = 480 (96 slots * 5 days)

Location: Random points for each user

以上数据的 Xtrain、Ytrain、Xtest、Ytest 是什么。 我需要根据 480 个时间戳来预测每个用户的下一个位置。

【问题讨论】:

  • 你尝试了什么,错误是什么?

标签: python keras time-series lstm


【解决方案1】:

keras lstm 层输入是一个形状为 (batch_size, timesteps, input_dim) 的 3D 张量。从这里的文档https://keras.io/layers/recurrent/

所以在您的情况下,它应该是 [batch_size, 480, 2] (如果 lstm 的唯一尺寸是“插槽”和“位置”变量。

【讨论】:

  • 我们如何划分Xtrain和Ytrain?
  • 还有 Xtest 和 Ytest
猜你喜欢
  • 2018-04-21
  • 2020-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多