我是靠谱客的博主 美丽小天鹅,这篇文章主要介绍神经网络预测路温,现在分享给大家,希望可以做个参考。

神经网络预测路温
(笔记,自用)

训练输入:12/1-2/29每分钟的主站点气温、露点、湿度
训练输出:12/1-2/29每分钟的主站点路温
测试输入:某时间(冬天时间最佳)主站点气温、露点、湿度
测试输出:某时间(冬天时间最佳)路温

代码如下:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clc; clear all; % Solve an Input-Output Fitting problem with a Neural Network % Script generated by Neural Fitting app % Created 25-Nov-2019 14:58:54 % % This script assumes these variables are defined: % % inputs - input data. % targets - target data. x=xlsread('HaiDian_HD002_StationRTW_ALL.xlsx','D42187:F172574');%12/1-2/29的数据 y=xlsread('HaiDian_HD002_StationRTW_ALL.xlsx','G42187:G172574');%交通站路温列 inputs = x';%转置 targets = y'; x = inputs; t = targets; % Choose a Training Function % For a list of all training functions type: help nntrain % 'trainlm' is usually fastest. % 'trainbr' takes longer but may be better for challenging problems. % 'trainscg' uses less memory. Suitable in low memory situations. trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation. % Create a Fitting Network hiddenLayerSize = 10; net = fitnet(hiddenLayerSize,trainFcn); % Setup Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; % Train the Network [net,tr] = train(net,x,t); % Test the Network y = net(x); e = gsubtract(t,y); performance = perform(net,t,y); % View the Network % view(net) % Plots % Uncomment these lines to enable various plots. %figure, plotperform(tr) %figure, plottrainstate(tr) %figure, ploterrhist(e) %figure, plotregression(t,y) %figure, plotfit(net,x,t) z=xlsread('HaiDian_HD002_StationRTW_ALL.xlsx','D172574:F172754');%预测的数据 testinputs= z';%转置 testoutputs = net(testinputs);%预测结果值 a=xlsread('HaiDian_HD002_StationRTW_ALL.xlsx','G172574:G172754');%实际的数据 A=a'; B=testoutputs; E=A-B; figure,plot(A,'r');hold on plot(B,'b');hold on plot(E,'g'); grid on xlabel('预测时间点') ylabel('温度值') legend('实际值','预测值','误差值') title('预测结果对比'); % xlswrite('HaiDian_HD002_StationRTW_ALL.xlsx',testoutputs','H172574'); %如果训练满意,可以保存训练好网络(保存文件名,网络名,) %save('training_net.mat','net','tr');

最后

以上就是美丽小天鹅最近收集整理的关于神经网络预测路温的全部内容,更多相关神经网络预测路温内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部