BP神经网络做数据预测,预测出来结果感觉不对,求大神指导 5
我的程序:clcclearallA=xlsread('C:\Users\kanghui\Desktop\data.xlsx','Sheet1','B1:B1000');p...
我的程序:clcclear allA=xlsread('C:\Users\kanghui\Desktop\data.xlsx','Sheet1','B1:B1000');p0=A';for i = 1:900 p(:,i)=[p0(i) p0(i+1) p0(i+2) p0(i+3) p0(i+4)]; t(i) = p0(i+5); end% 创建神经网络net = newff(p,t,[3],{'logsig','purelin'},'trainlm');% 设置训练参数net.trainParam.show = 100;%两次显示之间的训练次数net.trainParam.epochs = 1000;%训练次数net.trainParam.goal = 1e-3;%网络性能目标% 开始训练net = trainlm(net,p,t);for i=1:100 ptest(:,i) = [p0(885+i) p0(886+i) p0(887+i) p0(888+i) p0(889+i)]'; ttest(i) = p0(900+i);endresult_test1 = sim(net,ptest);for i = 1:100delta(i) = result_test1(i) - ttest(i);err(i) = delta(i)/ttest(i); endperf = mse(err);plot(ttest,'b-o');hold onplot(result_test1,'r-*');hold offaxis([1 100 0 40]);我预测的结果:
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询