个人主页:研学社的博客
欢迎来到本博客❤️❤️
博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
本文目录如下:
目录
1 概述
2 运行结果
3 参考文献
4 Python代码实现
本文基于5个工作市场日,使用循环神经网络(长短期记忆)预测第二天的价格,然后用Python代码实现之。
train_index = round(len(df)*0.1) train = df[:-train_index] test = df[-train_index:] from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler(feature_range=(0,1)) train = scaler.fit_transform(train.reshape(-1,1)) test = scaler.transform(test.reshape(-1,1))
Epoch 1/15
1176/1176 [==============================] - 4s 4ms/step - loss: 0.0079 - val_loss: 0.0012
Epoch 2/15
1176/1176 [==============================] - 5s 4ms/step - loss: 0.0011 - val_loss: 0.0043
Epoch 3/15
1176/1176 [==============================] - 4s 4ms/step - loss: 9.7493e-04 - val_loss: 7.1246e-04
Epoch 4/15
1176/1176 [==============================] - 5s 4ms/step - loss: 8.6890e-04 - val_loss: 4.8759e-04
Epoch 5/15
1176/1176 [==============================] - 5s 4ms/step - loss: 8.1263e-04 - val_loss: 4.9513e-04
Epoch 6/15
1176/1176 [==============================] - 4s 4ms/step - loss: 6.7742e-04 - val_loss: 4.1102e-04
Epoch 7/15
1176/1176 [==============================] - 5s 5ms/step - loss: 6.1346e-04 - val_loss: 5.4533e-04
Epoch 8/15
1176/1176 [==============================] - 6s 5ms/step - loss: 5.3698e-04 - val_loss: 4.8133e-04
Epoch 9/15
1176/1176 [==============================] - 5s 4ms/step - loss: 4.8843e-04 - val_loss: 4.6157e-04
部分理论来源于网络,如有侵权请联系删除。
[1]李高平,邱治邦,苗加庆,王静,任小洁,程日鑫.基于LSTM的空气质量预测模型[J].西南民族大学学报(自然科学版),2023,49(01):67-73.