In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to use the nftool neural network fitting tool, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
In data fitting, the neural network needs to deal with the mapping from one data set to another, such as estimating house prices through raw material prices, land prices, bank interest rates and other factors. Raw material prices, land prices and bank interest rates belong to one data set, which is input in the network, while house prices belong to another data set and output in the network. The fitting tool of neural network can be used to collect data, establish and train the network, and evaluate the effect of the network by mean square error and regression analysis.
Nftool toolbox uses feedforward neural network to complete data fitting, including two layers of neurons, the hidden layer uses sigmoid transfer function, and the output layer is linear. Given enough training data and enough hidden layer neurons, the network can fit multi-dimensional data well.
Generate a section of sine function data with uniform noise.
X=0:.2:2*pi+.2
Rng (2); y=sin (x) + rand (1)
Plot (xmeme yjinghuomuri')
Enter nftool on the command line and enter to launch the neural network fitting tool dialog box
Click Next to enter the data selection interface, specifying not only the input data, but also the target data, that is, the expected output of the input data
Click Next to enter the Validation and Test Data interface, and the toolbox divides the data into three parts:
1. Training sample, used for network training, the network will adjust the network weight and threshold according to the error of the training sample.
two。 The verification sample is used to verify the generalization performance of the network. when the generalization performance stops improving, it indicates that the network has reached the optimal state, and the training will be stopped at this time.
3. Test samples, used to test the performance of the network, the network will not branch test sample results to make any adjustments
In general, training samples are used to adjust network weights and thresholds, while verification samples are used to adjust network structure, such as the number of neurons in the hidden layer.
By default, 70% of the data is randomly classified as training samples, 15% as verification samples, and the remaining 15% as test samples.
Click Next to enter the network structure interface and set the number of neurons in the hidden layer
Click Next to enter the training interface, click Train for network training, the toolbox automatically pop-up training dialog box to show the training process, the default maximum number of iterations is 1000.
After the training is completed, the mean square error (MSE) and R value of the training sample, verification sample and test sample will be displayed. The R value measures the correlation between the target data (expected output) and the actual output. If the correlation is 1, the two are completely consistent, and if the correlation is 0, the data is completely random.
Click Plot Fit to show fitness after training, and show the target output and actual output of training samples, verification samples and test samples at the same time
Click Plot Error Histgram to display the error histogram
The formula for calculating the error is:
Error = target output-actual output
Click Plot Regression to display the regression graph, showing the regression graphs of training samples, verification samples, test samples and all data, respectively.
Click Next to enter the test interface, select the test data and expected output, and click Test Network to test. After the test is completed, you can click to display the fitness diagram, error histogram and regression diagram.
Test data generation
Xx=0:.1:2*pi+.2
Yy=sin (xx) + 0.25
Click Next to enter the results interface and select the type you want to generate. You can generate MATLAB script files or convert them to Simulink models.
Finally, click Finish to finish data fitting.
The above is how to use the nftool neural network fitting tool. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.