lstm - LSTM 预测罕见事件
问题描述
我有两列的数据框:日期,卷。我想按日期预测罕见事件的数量。你能给我一个例子或建议吗?谢谢大家
更新:我使用自动编码器来预测音量,它非常适合。但我想知道结果。有什么建议吗?
# define model
model = Sequential()
model.add(LSTM(128, activation='relu', input_shape=(7,1),
return_sequences=True))
model.add(LSTM(64, activation='relu', return_sequences=False))
model.add(RepeatVector(1))
model.add(LSTM(64, activation='relu', return_sequences=True))
model.add(LSTM(128, activation='relu', return_sequences=True))
model.add(TimeDistributed(Dense(1)))
model.compile(optimizer='adam', loss='mse')
model.summary()
# fit model
model.fit(x_train, x_train, epochs=100, batch_size=5, verbose=0
此处的数据和结果:在此处 输入链接描述
解决方案
推荐阅读
- python - Python测试http-server:我做错了什么?
- java - 使用 gson 时 Android 应用程序 API 调用错误
- javascript - React native - 在渲染应用程序组件之前从异步存储中获取数据
- c# - 逗号作为C#中的数组长度是什么意思
- node.js - 模块导出:从 oracle 调用过程然后分配全局变量并在 Node js 中使用该变量的另一个文件?
- c# - 覆盖 GetRolesAsync
- c - .gitignore 除了 .c 和 .h 以外的所有东西递归
- python - 自动写入几个txt到目录
- r - 如何从 R 数据框中过滤今天的数据?
- javascript - 如何将数据从 javascript 函数发送到 Django View