Main Content

Neural Net Fitting

Fit data by training a two-layer feed-forward network


The Neural Net Fitting app leads you through solving a data-fitting problem using a two-layer feed-forward network. It helps you select data, divide it into training, validation, and testing sets, define the network architecture, and train the network. You can select your own data from the MATLAB® workspace or use one of the example datasets. After training the network, evaluate its performance using mean squared error and regression analysis. Further analyze the results using visualization tools such as a regression fit or histogram of the errors. You can then evaluate the performance of the network on a test set. If you are not satisfied with the results, you can retrain the network with modified settings or on a larger data set.

You can generate MATLAB scripts to reproduce results or customize the training process. You can also save the trained network to test on new data or use for solving similar fitting problems. The app also provides the option to generate various deployable versions of your trained network. For example, you can deploy the trained network using MATLAB Compiler™, MATLAB Coder™, or Simulink® Coder tools.

Required Products


  • Deep Learning Toolbox™

Open the Neural Net Fitting App

  • MATLAB Toolstrip: On the Apps tab, under Machine Learning, click the app icon.

  • MATLAB command prompt: Enter nftool.