预测值与真实值差距很大,应该怎么修改

load C:\Users\Song\Desktop\p.txt
load C:\Users\Song\Desktop\t.txt;
save p.mat;
save t.mat;
p=p;
t=t;
[p1,ps]=mapminmax(p);
[t1,ts]=mapminmax(t);
net=newff(minmax(p1),[6 1],{'tansig' 'purelin'},'traingdx');
net.trainParam.epochs=10000;
net.trainParam.goal=1e-7;
net.trainParam.lr=0.015;
net.trainParam.show=5;
[net,tr]=train(net,p1,t1);
pw=[15053 25663 36036;2901.07 3063.31 3153.44;1961.9 2018.6 2069.3;29073 32903 36469;19934 21984 24046;75573 83547 89778];
pwn=mapminmax(pw);
awn=sim(net,pwn);
aw=mapminmax('reverse',awn,ts);
想问问如何修改
补充一下
load C:\Users\Song\Desktop\p.txt
load C:\Users\Song\Desktop\t.txt;
save p.mat;
save t.mat;
p=p;
t=t;
[p1,ps]=mapminmax(p);
[t1,ts]=mapminmax(t);
[trainsample.p1,valsample.p1,testsample.p1] =dividerand(p1,0.7,0.15,0.15);
[trainsample.t1,valsample.t1,testsample.t1] =dividerand(t1,0.7,0.15,0.15);
net=newff(minmax(trainsample.p1),[6 1],{'tansig' 'purelin'},'trainlm');
net.trainParam.epochs=10000;
net.trainParam.goal=1e-7;
net.trainParam.lr=0.015;
net.trainParam.show=5;
[net,tr]=train(net,trainsample.p1,trainsample.t1);
这个模型是我在matlab论坛发表的提问,预测值跟真实值一样存在很大差距

4个回答

之前有个人有跟你一样得问题,他是用下叙的方法解决得,
不知道对你是不是适用,至少可以排除一个错误类型

oad C:\Users\Song\Desktop\p.txt
load C:\Users\Song\Desktop\t.txt;
save p.mat;
save t.mat;
p=p;
t=t;
[p1,ps]=mapminmax(p);
[t1,ts]=mapminmax(t);
[trainsample.p1,valsample.p1,testsample.p1] =dividerand(p1,0.7,0.15,0.15);
[trainsample.t1,valsample.t1,testsample.t1] =dividerand(t1,0.7,0.15,0.15);
net=newff(minmax(trainsample.p1),[6 1],{'tansig' 'purelin'},'trainlm');
net.trainParam.epochs=10000;
net.trainParam.goal=1e-7;
net.trainParam.lr=0.015;
net.trainParam.show=5;
[net,tr]=train(net,trainsample.p1,trainsample.t1);

a190504991
单纯小白 我在matlab论坛也问过同样的问题,就是训练函数用的trainlm,这个问题上用的traingdx在预测上都跟真实值差距过大
2 年多之前 回复

oad C:\Users\Song\Desktop\p.txt
load C:\Users\Song\Desktop\t.txt;
save p.mat;
save t.mat;
p=p;
t=t;
[p1,ps]=mapminmax(p);
[t1,ts]=mapminmax(t);
[trainsample.p1,valsample.p1,testsample.p1] =dividerand(p1,0.7,0.15,0.15);
[trainsample.t1,valsample.t1,testsample.t1] =dividerand(t1,0.7,0.15,0.15);
net=newff(minmax(trainsample.p1),[6 1],{'tansig' 'purelin'},'trainlm');
net.trainParam.epochs=10000;
net.trainParam.goal=1e-7;
net.trainParam.lr=0.015;
net.trainParam.show=5;
[net,tr]=train(net,trainsample.p1,trainsample.t1);

a190504991
单纯小白 trainlm函数我也用过,差距还是很大
2 年多之前 回复

oad C:\Users\Song\Desktop\p.txt
load C:\Users\Song\Desktop\t.txt;
save p.mat;
save t.mat;
p=p;
t=t;
[p1,ps]=mapminmax(p);
[t1,ts]=mapminmax(t);
[trainsample.p1,valsample.p1,testsample.p1] =dividerand(p1,0.7,0.15,0.15);
[trainsample.t1,valsample.t1,testsample.t1] =dividerand(t1,0.7,0.15,0.15);
net=newff(minmax(trainsample.p1),[6 1],{'tansig' 'purelin'},'trainlm');
net.trainParam.epochs=10000;
net.trainParam.goal=1e-7;
net.trainParam.lr=0.015;
net.trainParam.show=5;
[net,tr]=train(net,trainsample.p1,trainsample.t1);

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问