This example shows how to create, train, and test Sugeno-type fuzzy systems using the Neuro-Fuzzy Designer.
To start the app, type the following command at the MATLAB® prompt:
The Neuro-Fuzzy Designer includes four distinct areas to support a typical workflow. The app lets you perform the following tasks:
Access the online help topics by clicking Help in the Neuro-Fuzzy Designer.
To train an FIS, you must begin by loading a Training data set that contains the desired input/output data of the system to be modeled. Any data set you load must be an array with the data arranged as column vectors, and the output data in the last column.
You can also load Testing and Checking data in the designer. For more information on testing and checking data sets, see Model Validation Using Testing and Checking Data Sets.
To load a data set using the Load data portion of the designer:
Specify the data Type.
Select the data from a file or the MATLAB worksp.
Click Load Data.
After you load the data, it displays in the plot. The training, testing and checking data are annotated in blue as circles, diamonds, and pluses respectively.
To clear a specific data set from the designer:
In the Load data area, select the data Type.
Click Clear Data.
This action also removes the corresponding data from the plot.
Before you start the FIS training, you must specify an initial FIS model structure. To specify the model structure, perform one of the following tasks:
Load a previously saved Sugeno-type FIS structure from a file or the MATLAB workspace.
Generate the initial FIS model by choosing one of the following partitioning techniques:
Grid partition— Generates a single-output Sugeno-type FIS by using grid partitioning on the data.
Sub. clustering — Generates an initial model for ANFIS training by first applying subtractive clustering on the data.
To view a graphical representation of the initial FIS model structure, click Structure.
After loading the training data and generating the initial FIS structure, you can start training the FIS.
If you want to save the training error generated during ANFIS training to the MATLAB workspace, see Save Training Error Data to MATLAB Workspace.
The following steps show you how to train the FIS.
In Optim. Method, choose hybrid or backpropaga as the optimization method.
The optimization methods train the membership function parameters to emulate the training data.
The hybrid optimization method is a combination of least-squares and backpropagation gradient descent method.
Enter the number of training Epochs and the training Error Tolerance to set the stopping criteria for training.
The training process stops whenever the maximum epoch number is reached or the training error goal is achieved.
Click Train Now to train the FIS.
This action adjusts the membership function parameters and displays the error plots.
Examine the error plots to determine overfitting during the training. If you notice the checking error increasing over iterations, it indicates model overfitting. For examples on model overfitting, see Checking Data Helps Model Validation and Checking Data Does Not Validate Model.
After the FIS is trained, validate the model using a Testing or Checking data that differs from the one you used to train the FIS. To validate the trained FIS:
Select the validation data set and click Load Data.
Click Test Now.
This action plots the test data against the FIS output (shown in red) in the plot.
For more information on the use of testing data and checking data for model validation, see Model Validation Using Testing and Checking Data Sets.