File Exchange > DataAnalysis >    Neural Network Fitting

OriginLab Technical Support
Date Added:
Last Update:
Downloads (90 Days):
Total Ratings:
File Size:
324 KB
Average Rating:
File Name:
File Version:
Minimum Versions:

Fit data with neural network.

Screen Shot and Video:


This App provides a tool for fitting data with neural network. It trains a neural network to map between a set of inputs and output. You can use it to predict response of independent variables. 


The app requires R software and package (neuralnet).

  1. Install R or upgrade it before installing the App (Minimum required version 3.4.1. Please download R from here.).
  2. Download the neuralnetfit.opx file, then drag-and-drop onto the Origin workspace.
  3. The App will start downloading dependent R packages automatically. Wait a few minutes until the download is completed.

        Note: If auto download fails, a pop-up dialog will ask you to copy 2 lines of commands from Results Log and run them in R to complete package download. 
                 If you reinstall or upgrade R after installing the app, it would not work properly. Please reinstall the app.


  1. Activate a worksheet or a graph. Click the App icon to bring up the dialog.
  2. On Input Data tab, select single or multiple datasets for Independent Variables and specify Dependent Variable by selecting a single dataset.
  3. On Options tab, change settings to fit a neural network.
    • Number of Layers: Number of layers between input and output.
    • Number of Hidden Neurons in Each Layer: Specify space-separated list of number of hidden neurons. For example, if the 1st layer contains 3 neurons and 2nd layer contains 2 neurons, enter '3 2'.
    • Training Repetitions: The number of repetitions for the neural network’s training. The one with the minimum error is reported.
    • Neural Network Algorithm: Algorithm to calculate the neural network weights.
    • Error Function: Function to minimize in search for the optimum weights. Also called cost function. 
    • Threshold of Error Function: A numeric value specifying the threshold for the partial derivatives of the error function as stopping criteria.
    • Activation Function: Function that is used for smoothing the result.
    • K-fold Cross Validation: The data sample is split into K groups. For each unique group, take the group as a test data set. Take the remaining groups as a training data set. Fit a model on the training set and evaluate it on the test set.
    • Print Progress Messages: Print threshold value at each iteration step.
  4. On Quantities and Plots tab, choose which quantities and plots to output.

    (Notes: Network Plot is NOT available for Origin version earlier than 2021b.)

  5. On Prediction tab, you can select a range of independent data to predict the response with the fitted neural network.
  6. Click OK to output reports.

Note: If neural network fitting fails, it may be because the neural network is too complex or the threshold of error function is too low. Try to use fewer layers and neurons or increase the threshold.

Sample OPJU File
This app provides a sample OPJU file.  Right click the App icon in the Apps Gallery window, and choose Show Samples Folder from the short-cut menu. A folder will open. Drag-and-drop the project file Neural Network Fitting Sample.opju from the folder onto Origin. The Notes window in the project shows detailed steps.
Note: If you wish to save the OPJU after changing, it is recommended that you save to a different folder location (e.g. User Files Folder).


v1.33: Support network plot for Origin 2021b.
v1.21: Add backpropagation algorithm.
v1.1: Add Print Progress Messages option.

Reviews and Comments:

11/17/2020OriginLabHi vghazikhanian,
You can try to use our new App "Neural Network Regression" (for version 2021) .

If this App still takes a long time for the large dataset, could you mind to send your dataset file to us? Then we can try to do more test and improve the Apps.

11/16/2020vghazikhanianThis is a very helpful app, but it needs to be faster by utilizing GPU or at the very least the multiple core processors' capabilities. Without this it takes too long to do even a moderate size data set.

Also one needs to get a feedback as the app is running. One needs the information on how the app is approaching the minimum RMSE.
The app output plot page for large data set and relatively moderate number of neurons is sluggish and unstable. In fact in some cases it disappears (nothing shows up).

10/09/2020OriginLabHi jlp1542,
The R library this App uses is "neuralnet".

10/03/2020JanekW86Unfortunately, I also get the error regarding R although the software is installed and also runs on other apps in Origin.

03/20/2020jlp1542What R libraries do you use in this app?

12/01/2019zhouzhizhe1101R software has been installed, but Origin still suggests to install that.

11/04/2019OriginLabHi Baojun, please download R software from the website, and install it as the description says.

11/04/2019BaojunHow to install R software

10/24/2019OriginLabHi, this app is for Origin 2020 and its later versions, which will release the end of October.