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

40 visualizaciones (últimos 30 días)
I am looking for a neural network that will do this: 
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) Save the output - predicted targets - to a readable file so that I can load the predictions into my separate program. 
I would like to learn minimal coding to get this done.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 4 de Mzo. de 2021
Editada: MathWorks Support Team el 4 de Mzo. de 2021
Please try following these steps:
1. To load your data and train and neural network on this data set, please follow the instructions on the “Fit Data with a Neural Network” documentation page. One of the sections on this page is “Using the Neural Network Fitting Tool.” This has detailed instructions on how to load the data, train the neural network, and save it to the MATLAB workspace. Here is the link:
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.
For example, you can save your workspace to a file called “myTrainedNN” with the following command:
save(myTrainedNN)
For more information on the “save” function, please refer to the following documentation link:
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)
For more information on the “load” function, please refer to the following documentation link:
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. To get the predicted targets, you can use your neural network from the Command Window.
If your neural network is called “net”, which is the default name, and your test data is called “myTestData”, you could get the predicted output with the following command:
output = net(myTestData)
The “output” variable hold the predicted targets.
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:

Más respuestas (0)

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by