Fuzzy Logic Toolbox    

ANFIS Editor GUI Example 2: Checking Data Doesn't Validate Model

In this example, we examine what happens when the training and checking data sets are sufficiently different. To see how the ANFIS Editor GUI can be used to learn something about data sets and how they differ:

  1. Clear both the training and checking data.
  2. You can also click the Clear Plot button on the right, although you don't have to.
  3. Load fuzex2trnData and fuzex2chkData (respectively, the training data and checking data) from the MATLAB workspace just as you did in the previous example.

You should get something that looks like this.

Train the FIS for this system exactly as you did in the previous example, except now choose 60 Epochs before training. You should get the following.

Notice the checking error is quite large. It appears that the minimum checking error occurs within the first epoch. Recall that using the checking data option with anfis automatically sets the FIS parameters to be those associated with the minimum checking error. Clearly this set of membership functions would not be the best choice for modeling the training data.

What's wrong here? This example illustrates the problem discussed earlier wherein the checking data set presented to anfis for training was sufficiently different from the training data set. As a result, the trained FIS did not capture the features of this data set very well. This illustrates the importance of knowing the features of your data set well enough when you select your training and checking data. When this is not the case, you can analyze the checking error plots to see whether or not the checking data performed sufficiently well with the trained model. In this example, the checking error is sufficiently large to indicate that either more data needs to be selected for training, or you may want to modify your membership function choices (both the number of membership functions and the type). Otherwise the system can be retrained without the checking data, if you think the training data captures sufficiently the features you are trying to represent.

To complete this example, let's test the trained FIS model against the checking data. To do so, click Checking data in the Test FIS portion of the GUI, and click Test Now. The following plot in the GUI indicates that there is quite a discrepancy between the checking data output and the FIS output.


  ANFIS Editor GUI Example 1: Checking Data Helps Model Validation ANFIS from the Command Line