👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
本文包括以下5个部分
模型构建:
训练出模型,然后就可以预测任意一天的96个时刻点的负荷。
📚2 运行结果
预测日:
部分代码:
max_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最高温度'), [2]].values / 20 min_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最低温度'), [2]].values / 20 avg_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '平均温度'), [2]].values / 20 humidity = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '湿度'), [2]].values / 100 weather_data = np.concatenate([max_tempe, min_tempe, avg_tempe, humidity]).reshape((1, -1)) type_of_day = np.eye(7)[date.dayofweek] holiday = np.eye(2)[int(is_holiday(date))] time_data = np.concatenate([type_of_day, holiday]).reshape((1, -1)) features = np.concatenate([load_data, weather_data, time_data], axis=1).reshape(1, 685) features = Tensor(features) print('Loading model...') net = load('./model.pt', map_location='cpu') print('Start predicting...') net.eval() labels = net(features).detach().numpy() * 7000 print('=========预测==============')
max_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最高温度'), [2]].values / 20 min_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '最低温度'), [2]].values / 20 avg_tempe = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '平均温度'), [2]].values / 20 humidity = df_weather.loc[(df_weather[0] == predict_date) & (df_weather[1] == '湿度'), [2]].values / 100 weather_data = np.concatenate([max_tempe, min_tempe, avg_tempe, humidity]).reshape((1, -1)) type_of_day = np.eye(7)[date.dayofweek] holiday = np.eye(2)[int(is_holiday(date))] time_data = np.concatenate([type_of_day, holiday]).reshape((1, -1)) features = np.concatenate([load_data, weather_data, time_data], axis=1).reshape(1, 685) features = Tensor(features) print('Loading model...') net = load('./model.pt', map_location='cpu') print('Start predicting...') net.eval() labels = net(features).detach().numpy() * 7000 print('=========预测==============')
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]陆继翔,张琪培,杨志宏,涂孟夫,陆进军,彭晖.基于CNN-LSTM混合神经网络模型的短期负荷预测方法[J].电力系统自动化,2019,43(08):131-137.
[2]罗澍忻,陆秋瑜,靳冰洁,麻敏华.考虑相关因素的长短时记忆网络短期负荷预测方法[J].机电工程技术,2019,48(12):126-129.
[3]王增平,赵兵,纪维佳,高欣,李晓兵.基于GRU-NN模型的短期负荷预测方法[J].电力系统自动化,2019,43(05):53-62.
[4] 牛腾腾.电力系统短期负荷预测 2017,01104