首页 > 解决方案 > How to use the trained network for prediction using new input

问题描述

My Input is:

x=[13000 x 7]:  (13000 rows and 7 columns)
and My Target is t=[13000 x 2]:

This is the t matrix data Foramt:

0     1     1     1     0  ...
1     0     0     0     1  ...

The network was trained using the code provided by MATLAB and The network was trained and worked fine. net = train(net,x,t);

MY QUESTION: I have new inputs (xnew) that I want to predict the output based on the trained network. The new inputs are not part of the trained network. I just want to predict the outcome from the new set of inputs. So i used tnew=net(xnew): but the output of the new data (xnew) is as follows:

0.6951    0.8703    0.8087    0.8034    0.9182    ...
0.3049    0.1297    0.1913    0.1966    0.0818    ...

According to the calculations, but the output should be 0 or 1, please advise what to do.

标签: matlabneural-network

解决方案


我认为这是您的代码的概率。您应该将概率转换为预测。如果您指定阈值并使用简单的 if 方法(例如,如果 > 阈值,它将返回 1,否则返回 0)可能对您有所帮助。


推荐阅读