Train Adaptive Neuro-Fuzzy Inference Systems

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:

neuroFuzzyDesigner

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.

Loading, Plotting, and Clearing the Data

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:

  1. Specify the data Type.

  2. Select the data from a file or the MATLAB worksp.

  3. 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:

  1. In the Load data area, select the data Type.

  2. Click Clear Data.

This action also removes the corresponding data from the plot.

Generating or Loading the Initial FIS Structure

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.

Training the FIS

After loading the training data and generating the initial FIS structure, you can start training the FIS.

Tip

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.

  1. In Optim. Method, choose hybrid or backpropaga as the optimization method.

    The optimization methods train the membership function parameters to emulate the training data.

    Note

    The hybrid optimization method is a combination of least-squares and backpropagation gradient descent method.

  2. 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.

  3. 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.

Validating the Trained FIS

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:

  1. Select the validation data set and click Load Data.

  2. 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.

See Also

Related Topics