anfisOptions
(Not recommended) ANFIS tuning options
anfisOptions is not recommended. When tuning a fuzzy inference system
using tunefis, specify options using the
MethodOptions property of a tunefisOptions object. For
more information, see Not recommended.
Description
returns a default option
set for tuning a Sugeno fuzzy inference system using opt = anfisOptionsanfis. To modify
options, use dot notation.
specifies options using one or more name-value arguments. For example, opt = anfisOptions(Name=Value)opt =
anfisOptions(EpochNumber=50) sets the number of training epochs to 50.
Examples
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 variable
Maximum 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 arguments.
opt2 = anfisOptions(InitialFIS=4,EpochNumber=30);
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: opt = anfisOptions(EpochNumber=50) sets the number of
training epochs to 50.
Initial FIS structure to tune, specified as one of the following values.
Positive integer greater than
1specifying the number of membership functions for all input variables.anfisgenerates an initial FIS structure with the specified number of membership functions usinggenfiswith 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.
anfisgenerates an initial FIS structure with the specified numbers of membership functions usinggenfiswith grid partitioning.FIS structure generated using the
genfisfunction 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".The number of output membership functions must equal the number of rules and each rule must use a different output membership function.
Unity weight for each rule.
No custom membership functions or defuzzification methods.
Maximum number of training epochs, specified as a positive integer. The training process stops when it reaches the maximum number of training epochs.
Training error goal, specified as a scalar. The training process stops when the
training error is less than or equal to ErrorGoal.
Initial training step size, specified as 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).
Step-size decrease rate, specified as 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.
Step-size increase rate, specified as a scalar greater than 1.
If the training error decreases for four consecutive epochs, then
anfis scales the step size by the increase rate.
Flag for showing ANFIS information at the start of the training process, specified as one of the following values.
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.
Flag for showing training error values after each training epoch, specified as one of the following values.
1— Display the training error.0— Do not display the training error.
Flag for showing step size whenever the step size changes, specified as one of the following values.
1— Display the step size.0— Do not display the step size.
Flag for displaying final results after training, specified as one of the following values.
1— Display the results.0— Do not display the results.
Validation data for preventing overfitting to the training data, specified as 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.
Optimization method used in membership function parameter training, specified as one of the following values.
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.
Output Arguments
Options for ANFIS training, returned as an ANFIS training options object.
Version History
Introduced in R2017aanfisOptions is not recommended. When tuning a fuzzy inference
system using tunefis, specify options using the
MethodOptions property of a tunefisOptions
object.
This table shows some typical usages of anfis and
anfisOptions and how to update your code to use
tunefis and tunefisOptions.
| Not recommended | Recommended |
|---|---|
opt = anfisOptions(EpochNumber=40); fis = anfis(trnData,opt); where the first two columns of
|
inFIS = genfis(trnData(:,1:2),trnData(:,3)); opt = tunefisOptions(Method="anfis"); opt.MethodOptions.EpochNumber = 40; fis = tunefis(inFIS,[], ... trnData(:,1:2),trnData(:,3),opt); |
opt = anfisOptions(InitialFIS=4); fis = anfis([trnX trnY],opt); |
genOpt = genfisOptions("GridPartition"); genOpt.NumMembershipFunctions = 4; inFIS = genfis(trnX,trnY,genOpt); opt = tunefisOptions(Method="anfis"); fis = tunefis(inFIS,[],trnX,trnY,opt); |
opt = anfisOptions(ValidationData=[valX valY]);
[trnFIS,trnError,stepSize,valFIS,valError] = ...
anfis([trnX trnY],opt); |
inFIS = genfis(trnX,trnY); opt = tunefisOptions(Method="anfis"); opt.MethodOptions.ValidationData = [valX valY]; [trnFIS,summary] = tunefis(inFIS,[], ... trnX,trnY,opt); trnError = summary.tuningOutputs.trainError; stepSize = summary.tuningOutputs.stepSize; valFIS = summary.tuningOutputs.chkFIS; valError = summary.tuningOutputs.chkError; |
See Also
tunefis | tunefisOptions | anfis | genfis
MATLAB Command
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.
Select a Web Site
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: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)