How do I use the neural network fitting tool to predict targets?

54次观看(最近30天)
我正在寻找可以做到这一点的神经网络:
1) Load my commodity futures data set of about 6000 rows with 6 inputs and 1 target in each row AND
2) Train a NN on that data set, save it AND
3) Load about 2000 rows of test data which has 6 inputs and of course, no targets into that trained network AND
4)保存输出——预测目标readable file so that I can load the predictions into my separate program.
I would like to learn minimal coding to get this done.

Accepted Answer

Mathworks支万博1manbetx持团队
编辑:Mathworks支万博1manbetx持团队 on 4 Mar 2021
Please try following these steps:
1.为了在此数据集上加载数据并训练和神经网络,请按照“使用神经网络拟合数据”页面上的说明进行操作。此页面上的部分是“使用神经网络拟合工具”。这有有关如何加载数据,训练神经网络并将其保存到MATLAB工作区的详细说明。链接在这里:
2. Once the neural network is saved to the MATLAB workspace, you can save it to a MAT file using the “save” function. You can provide the “save” function with a filename, and any specific variables that you want to save.
例如,您可以将工作空间保存到一个名为“ mytrainednn”的文件,并具有以下命令:
save(myTrainedNN)
有关“保存”功能的更多信息,请参阅以下文档链接:
Once your workspace is saved to your computer, you can load that MAT file back into the MATLAB workspace anytime using the “load” function.
For example, to load the “myTrainedNN” file created above, you would use this command:
load(myTrainedNN)
有关“负载”功能的更多信息,请参阅以下文档链接:
3. To load your test data, you can use the Import Tool. Please refer to this documentation link for more information on how to load your data using a GUI:
4.要获得预测的目标,您可以从命令窗口使用神经网络。
如果您的神经网络称为默认名称“ NET”,并且您的测试数据称为“ mytestdata”,则可以使用以下命令获得预测的输出:
output = net(myTestData)
“输出”变量保留了预测的目标。
5. You can either save the predicted targets to a MAT file using the “save” function from above, or export it to a more readable format. For example, if you wanted to save it to a Microsoft Excel file, you can use the “xlswrite” function.
This documentation link has information on how to save your output to an Excel spreadsheet:
1 Comment
John Doe
John Doe on 1 Apr 2020
But what if I want to do the same thing and I don't have the Tool?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!