why the prediction of neural network is wrong?
1 次查看(过去 30 天)
显示 更早的评论
Hi
I have a matrix of input data (1X1006) and a 1X1006 target matrix. I trained the network and it gave me the regression line with R=0.98 and performance of 9.48E-10. I saved the trained network and used it for a new set of data to predict the target, but it gave me a negative number. I did not have any negative number in target when network was being trained. the new input is also a number completely in the range of my first input. I also need to mention that the range of input is between 0.002 to 7000 and the range of target is 0.00005 to 0.02. what is wrong ? Thanks
x=xlsread('input.xlsx');
t=xlsread('target.xlsx');
net = fitnet(10);
[net,tr] = train(net,x,t);
y=net(x);
nntraintool
farnet=net;
save farnet
testX = x(:,tr.testInd);
testT = t(:,tr.testInd);
testY = net(testX);
perf = mse(net,testT,testY)
figure
e = t - y;
ploterrhist(e)
hold on
figure
y = net(x);
plotregression(t,y)
load farnet
newinput=xlsread('newinput.xlsx');
newoutput = farnet(newinput)
0 个评论
采纳的回答
Greg Heath
2018-7-26
1.There is nothing in your design to prevent negative outputs.
2. Therefore the question is
What are the ranks of the ABSOLUTE VALUES of the negative
output errors?
3. If this still bothers you, use a nonnegative output function.
Hope this helps.
Thank you for formally accepting my answer
Greg
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!