EDA365电子论坛网

标题: 有关MATLAB神经网络预测的问题,请问我这个最后输出的五个值分别是未来五年的值吗? [打印本页]

作者: smileqq    时间: 2019-9-17 17:35
标题: 有关MATLAB神经网络预测的问题,请问我这个最后输出的五个值分别是未来五年的值吗?
有关MATLAB神经网络预测的问题,请问我这个最后输出的五个值分别是未来五年的值吗?$ g3 D5 t0 h, D

+ H2 a5 c# e( F# W( V+ J
: D- V; Q" Z' y; `! e$ a

clc
1 d4 j5 {1 O3 `clear all+ p9 o8 x1 f9 p- h/ E
%%
) Y, f* N; ^: r/ R0 S2 S! H%输入数据和输出数据
* D$ I, Z% B+ S- j% JP = [24358, 24242, 26377;
- V# f- K) I6 g24242, 26377, 23125.2;! d$ E; W1 w8 _( p. z/ P, d
26377, 23125.2, 29797.6;
7 N. L& A" N3 y+ S0 b2 N23125.2, 29797.6, 22213.6;
* g: h, Z, w8 D" ~( s+ @29797.6, 22213.6, 28373.3;
1 _8 L0 G" V3 t1 U3 {7 v7 ]22213.6, 28373.3, 26839.5;
/ a/ g; b3 g4 F4 v28373.3, 26839.5, 26263.9];) j* n) m1 k  J' f, U# ^
T = [23125.2 29797.6 22213.6 28373.3 26839.5 26263.9 26900.8];
/ X" S7 g, W8 g, F; B%归一化数据
- T- V& Z& H  ^& v' V/ D[input,inputps] = mapminmax(P,0,1);' ?8 A8 {$ O7 H( }  Z  b2 o- t5 d
[output,outputps] = mapminmax(T,0,1);2 j7 K6 Y' Y$ p. j' @
%%8 O) f0 q8 H4 ]7 }
%构建BP神经网络" b: f9 p7 V& x2 s8 z& h0 k
net = newff(input',output,[4,6]);/ v  Y6 ?( u4 y
%训练神经网络
8 V2 H. [2 }3 I( U7 x% X8 vnet.trainParam.epochs = 100000;- i% _. J8 `5 H9 H& {
net.trainParam.goal = 0.000001;
( {: F# q/ O- h! w7 E) E3 s9 gnet.trainParam.lr = 0.18 U" d9 h" ^. w' m3 a' A
net = train(net,input',output);
: }- t2 S! S! Z9 ~%%
+ q# f# F0 M+ h7 v%%预测结果
, R' \7 e( P4 V, j%神经网络输出' |  q, U; J9 \* e! \/ e5 l
sim_out_1 = sim(net,[ 28373.3, 26839.5, 26263.9]');" A4 J! \* y9 {: m0 J$ M6 ]
sim_out_2 = sim(net,[ 26839.5, 26263.9, sim_out_1]');
  j, S' Z7 W: S" n. rsim_out_3 = sim(net,[ 26263.9, sim_out_1, sim_out_2]');
7 p" @- w/ d; C) c- s. |sim_out_4 = sim(net,[ sim_out_1, sim_out_2, sim_out_3]');; W& B* ]5 U8 C( Y1 O" m
sim_out_5= sim(net,[ sim_out_2, sim_out_2, sim_out_4]');8 H: ?1 W# o7 y1 A
%反归一化,最终结果7 n+ L  l& \1 _% W# N
sim_out = mapminmax('reverse',sim_out_1,outputps)3 B9 C( a( t6 L
sim_out = mapminmax('reverse',sim_out_2,outputps)
6 g4 O5 T+ A' J0 esim_out = mapminmax('reverse',sim_out_3,outputps)' s% D* G4 w! l% W$ L
sim_out = mapminmax('reverse',sim_out_4,outputps)2 }+ z! g9 [* g* u5 G: J
sim_out = mapminmax('reverse',sim_out_5,outputps)


0 ?/ {1 b! O) Z8 u

如果不对要怎么才能输出未来5年的数据?求指教,万分感谢!( K/ P2 j. d3 |7 R
最后还有一个问题,为什么我每次运行输出的结果都不一样呢?求指教

8 o0 z; h# ]+ c8 E; h8 e4 P1 r

3 r5 ^9 a, ^" I/ n1 O


0 S; f% Z. E7 \


8 w# ]( o8 ~( q& \* {
作者: xixihahaheihei    时间: 2019-9-18 20:08
好像知道这个的问题的解决方法




欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/) Powered by Discuz! X3.2