Option set for `anfis`

command

creates
an option set with options specified by one or more `opt`

= anfisOptions(`Name,Value`

)`Name,Value`

pair
arguments.

Create a default option set.

opt = anfisOptions;

Specify training options using dot notation. For example, specify the following options:

Initial FIS with

`4`

membership functions for each input variableMaximum number of training epochs equal to

`30`

.

opt.InitialFIS = 4; opt.EpochNumber = 30;

You can also specify options when creating the option set using one or more `Name,Value`

pair arguments.

opt2 = anfisOptions('InitialFIS',4,'EpochNumber',30);

Specify optional
comma-separated pairs of `Name,Value`

arguments. `Name`

is
the argument name and `Value`

is the corresponding value.
`Name`

must appear inside quotes. You can specify several name and value
pair arguments in any order as
`Name1,Value1,...,NameN,ValueN`

.

`'EpochNumber',50`

sets the maximum number of training epochs to
`50`

.`'InitialFIS'`

— Initial FIS structure`2`

(default) | positive integer greater than `1`

| vector of positive integers | FIS structureInitial FIS structure to tune, specified as the comma-separated
pair consisting of `'InitialFIS'`

and one of the
following:

Positive integer greater than

`1`

specifying the number of membership functions for all input variables.`anfis`

generates an initial FIS structure with the specified number of membership functions using`genfis`

with grid partitioning.Vector of positive integers with length equal to the number of input variables specifying the number of membership functions for each input variable.

`anfis`

generates an initial FIS structure with the specified numbers of membership functions using`genfis`

with grid partitioning.FIS structure generated using

`genfis`

command with grid partitioning or subtractive clustering. The specified system must have the following properties:Single output, obtained using weighted average defuzzification.

First or zeroth order Sugeno-type system; that is, all output membership functions must be the same type and be either

`'linear'`

or`'constant'`

.No rule sharing. Different rules cannot use the same output membership function; that is, the number of output membership functions must equal the number of rules.

Unity weight for each rule.

No custom membership functions or defuzzification methods.

`'EpochNumber'`

— Maximum number of training epochs`10`

(default) | positive integerMaximum number of training epochs, specified as the comma-separated
pair consisting of `'EpochNumber'`

and a positive
integer. The training process stops when it reaches the maximum number
of training epochs.

`'ErrorGoal'`

— Training error goal`0`

(default) | scalarTraining error goal, specified as the comma-separated pair consisting
of `'ErrorGoal'`

and a scalar. The training process
stops when the training error is less than or equal to `ErrorGoal`

.

`'InitialStepSize'`

— Initial training step size`0.01`

(default) | positive scalarInitial training step size, specified as the comma-separated
pair consisting of `'InitialStepSize'`

and a positive
scalar.

The `anfis`

training algorithm tunes the
FIS parameters using gradient descent optimization methods. The training
step size is the magnitude of each gradient transition in the parameter
space. Typically, you can increase the rate of convergence of the
training algorithm by increasing the step size. During optimization, `anfis`

automatically
updates the step size using `StepSizeIncreaseRate`

and `StepSizeDecreaseRate`

.

Generally, the step-size profile during
training is a curve that increases initially,
reaches some maximum, and then decreases for the
remainder of the training. To achieve this ideal
step-size profile, adjust the initial step-size
and the increase and decrease rates
(`opt.StepSizeDecreaseRate`

,
`opt.StepSizeIncreaseRate`

).

`'StepSizeDecreaseRate'`

— Step-size decrease rate`0.9`

(default) | positive scalar less than
`1`

Step-size decrease rate, specified as the
comma-separated pair consisting of
`'StepSizeDecreaseRate'`

and a
positive scalar less than `1`

. If
the training error undergoes two consecutive
combinations of an increase followed by a
decrease, then `anfis`

scales
the step size by the decrease rate.

`'StepSizeIncreaseRate'`

— Step-size increase rate`1.1`

(default) | scalar greater than
`1`

Step-size increase rate, specified as the
comma-separated pair consisting of
`'StepSizeIncreaseRate'`

and a
scalar greater than `1`

. If the
training error decreases for four consecutive
epochs, then `anfis`

scales the
step size by the increase rate.

`'DisplayANFISInformation'`

— Flag for showing ANFIS information`1`

(default) | `0`

Flag for showing ANFIS information at the start of the training
process, specified as the comma-separated pair consisting of `'DisplayANFISInformation'`

and
one of the following:

`1`

— Display the following information about the ANFIS system and training data:Number of nodes in the ANFIS system

Number of linear parameters to tune

Number of nonlinear parameters to tune

Total number of parameters to tune

Number of training data pairs

Number of checking data pairs

Number of fuzzy rules

`0`

— Do not display the information.

`'DisplayErrorValues'`

— Flag for showing training error values`1`

(default) | `0`

Flag for showing training error values after each training epoch,
specified as the comma-separated pair consisting of `'DisplayErrorValues'`

and
one of the following:

`1`

— Display the training error.`0`

— Do not display the training error.

`'DisplayStepSize'`

— Flag for showing step size`1`

(default) | `0`

Flag for showing step size whenever the step size changes, specified
as the comma-separated pair consisting of `'DisplayStepSize'`

and
one of the following:

`1`

— Display the step size.`0`

— Do not display the step size.

`'DisplayFinalResults'`

— Flag for displaying final results`1`

(default) | `0`

Flag for displaying final results after training, specified
as the comma-separated pair consisting of `'DisplayFinalResults'`

and
one of the following:

`1`

— Display the results.`0`

— Do not display the results.

`'ValidationData'`

— Validation data`[]`

(default) | arrayValidation data for preventing overfitting to the training data,
specified as the comma-separated pair consisting of `'ValidationData'`

and
an array. For a fuzzy system with *N* inputs, specify `ValidationData`

as
an array with *N*+1 columns. The first *N* columns
contain input data and the final column contains output data. Each
row of `ValidationData`

contains one data point.

At each training epoch, the training algorithm validates the FIS using the validation data.

Generally, validation data should fully represent the features of the data the FIS is intended to model, while also being sufficiently different from the training data to test training generalization.

`'OptimizationMethod'`

— Optimization method`1`

(default) | `0`

Optimization method used in membership function parameter training,
specified as the comma-separated pair consisting of `'OptimizationMethod'`

and
one of the following:

`1`

— Use a hybrid method, which uses a combination of backpropagation to compute input membership function parameters, and least squares estimation to compute output membership function parameters.`0`

— Use backpropagation gradient descent to compute all parameters.

`opt`

— Training options for `anfis`

command`anfisOptions`

option setTraining options for `anfis`

command, returned
as an `anfisOptions`

option set.

A modified version of this example exists on your system. Do you want to open this version instead?

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web siteYou can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

- América Latina (Español)
- Canada (English)
- United States (English)

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)