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!