anfis
Tune Sugeno-type fuzzy inference system using training data
Syntax
Description
generates a single-output Sugeno fuzzy inference system (FIS) and tunes the
system parameters using the specified input/output training data. The FIS object
is automatically generated using grid partitioning. fis
= anfis(trainingData
)
The training algorithm uses a combination of the least-squares and backpropagation gradient descent methods to model the training data set.
tunes a FIS using the specified training data and options. Using this syntax,
you can specify:fis
= anfis(trainingData
,options
)
An initial FIS object to tune.
Validation data for preventing overfitting to training data.
Training algorithm options.
Whether to display training progress information.
[
returns the root mean square training
error for each training epoch.fis
,trainError
]
= anfis(___)
[
returns the training step size
at each training epoch.fis
,trainError
,stepSize
]
= anfis(___)
[
returns the validation data error for each training epoch,
fis
,trainError
,stepSize
,chkFIS
,chkError
]
= anfis(trainingData
,options
)chkError
, and the tuned FIS object for which the
validation error is minimum, chkFIS
. To use this syntax,
you must specify validation data using
options.ValidationData
.
Examples
Input Arguments
Output Arguments
Alternative Functionality
tunefis
Function
Starting in R2019a, you can tune a fuzzy system using tunefis
. This function provides
several other options for tuning algorithms, specified by the tunefisOptions
object.
To use ANFIS, specify the tuning algorithm as "anfis"
in
tunefisOptions
. Then, use
the options object as an input argument for tunefis
. For example:
Create the initial fuzzy inference system, and define the tunable parameter settings.
x = (0:0.1:10)';
y = sin(2*x)./exp(x/5);
options = genfisOptions('GridPartition');
options.NumMembershipFunctions = 5;
fisin = genfis(x,y,options);
[in,out,rule] = getTunableSettings(fisin);
Tune the membership function parameters with "anfis"
.
opt = tunefisOptions("Method","anfis"); fisout = tunefis(fisin,[in;out],x,y,opt);
Fuzzy Logic Designer App
Starting in R2023a, you can interactively tune an ANFIS system using the Fuzzy Logic Designer app. For an example, see Train Adaptive Neuro-Fuzzy Inference Systems.
References
[1] Jang, J.-S. R. "Fuzzy Modeling Using Generalized Neural Networks and Kalman Filter Algorithm." Proceedings of the Ninth National Conference on Artificial Intelligence (AAAI-91). (July 1991): 762–767.
[2] Jang, J.-S. R. "ANFIS: Adaptive-Network-based Fuzzy Inference Systems." IEEE Transactions on Systems, Man, and Cybernetics 23, no. 3 (May 1993): 665–685.