matlab - 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.
解决方案
我认为这是您的代码的概率。您应该将概率转换为预测。如果您指定阈值并使用简单的 if 方法(例如,如果 > 阈值,它将返回 1,否则返回 0)可能对您有所帮助。
推荐阅读
- php - phpWord 如何使用 PhpOffice\PhpWord\IOFactory::load 加载图像
- elasticsearch - 如何在字段中使用正则表达式查找关键字,如下所示
- matlab - 在matlab中使用if else语句绘制完整图
- java - 如何使用从 Java 到 TestRail 的 API 将测试用例添加到现有的测试运行中?
- google-maps - Xamarin 窗体自定义引脚单击
- android - 将 Spring Social 与原生 Android 应用程序集成
- powerbi - Weeknum 功能无法正常工作
- c++ - 寻找一种更好的方法来表示无符号字符数组
- powershell - 比较同一目录的不同版本(按修改日期)
- c# - 将 Nuget 包提供的 EXE 部署为 ClickOnce 安装的组件