如何在培训数据上获得预测结果?

发布于 2025-02-06 09:39:37 字数 493 浏览 0 评论 0原文

我有一个长期的短期内存(LSTM)深神经网络代码,使变量的多变量预测分为培训和测试集:数据库

from keras.layers import Dense, LSTM, Dropout

model=Sequential()
model.add(LSTM(units=50,return_sequences=True, input_shape=(1,5)))
model.add(Dropout(0.2))
model.add(LSTM(units=50))
model.add(Dropout(0.2))
model.add(Dense(1))
model.compile(optimizer='adam', loss='mean_squared_error')

model.fit(X_train_shape,y_train, epochs=100, batch_size=48)

分为培训和测试集。

作为最终结果,模型为我提供了测试数据集的预测结果。 我如何也能获得培训数据的预测结果?

I have a Long Short-Term Memory (LSTM) deep neural network code that makes multivariate forecasts of a variable, The database is split into a training and test set:

from keras.layers import Dense, LSTM, Dropout

model=Sequential()
model.add(LSTM(units=50,return_sequences=True, input_shape=(1,5)))
model.add(Dropout(0.2))
model.add(LSTM(units=50))
model.add(Dropout(0.2))
model.add(Dense(1))
model.compile(optimizer='adam', loss='mean_squared_error')

model.fit(X_train_shape,y_train, epochs=100, batch_size=48)

The database is split into a training and test set.

As final results the model gives me the forecast results on the test data set.
How can I get the prediction results of the training data as well?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文