genfis3
(To be removed) Generate fuzzy inference system from data using FCM clustering
genfis3
will be removed in a future release. Use genfis
instead. For more information, see Version History.
Syntax
Description
creates a Sugeno FIS using fuzzy c-means (FCM) clustering by extracting a set of rules that
models the training data behavior.fis
= genfis3(inputData
,outputData
)
generates a FIS of the specified type, either Mamdani or Sugeno.fis
= genfis3(inputData
,outputData
,type
)
specifies the number of clusters to use for the FCM clustering.fis
= genfis3(inputData
,outputData
,type
,numClusters
)
specifies additional clustering options.fis
= genfis3(inputData
,outputData
,type
,numClusters
,options
)
Examples
Generate Sugeno-Type FIS and Specify Number of Clusters
Create the input and output data.
Xin = [7*rand(50,1) 20*rand(50,1)-10]; Xout = 5*rand(50,1);
Generate a Sugeno-type FIS with 3 clusters.
opt = NaN(4,1);
opt(4) = 0;
fis = genfis3(Xin,Xout,'sugeno',3,opt);
The fourth input argument specifies the number of clusters. The fifth input
argument, opt
, specifies the options for the FCM algorithm. The
NaN
entries of opt
specify default option
values. Setting opt(4)
to 0
turns off the display
of iteration information at the command line.
To see the contents of fis
, use
showfis(fis)
.
Plot the input membership functions.
[x,mf] = plotmf(fis,'input',1); subplot(2,1,1) plot(x,mf) xlabel('Membership Functions for Input 1') [x,mf] = plotmf(fis,'input',2); subplot(2,1,2) plot(x,mf) xlabel('Membership Functions for Input 2')
Input Arguments
inputData
— Input data
array
Input data, specified as an N-column array, where N is the number of FIS inputs.
inputData
and outputData
must have the
same number of rows.
outputData
— Output data
array
Output data, specified as an M-column array, where M is the number of FIS outputs.
When using grid partitioning, outputData
must have one column.
If you specify more than one column for grid partitioning, genfis
uses the first column as the output data.
inputData
and outputData
must have the
same number of rows.
type
— Fuzzy system type
'sugeno'
(default) | 'mamdani'
Fuzzy system type, specified as either 'sugeno'
or
'mamdani'
.
numClusters
— Number of FCM clusters
'auto'
(default) | positive integer
Number of FCM clusters, specified as 'auto'
or a positive
integer.
The number of clusters determines the number of rules and membership functions in
the generated FIS. cluster_n
must be an integer or
'auto'
. When cluster_n
is
'auto'
, the function uses the subclust
algorithm with a cluster range of influence of 0.5 and the minimum and maximum values of
inputData
and outputData
as data scale factors
to find the number of clusters. See subclust
for more information.
options
— Clustering options
vector
Clustering options, specified as a vector with the following elements:
Option | Description | Default |
---|---|---|
options(1) | Exponent for the fuzzy partition matrix If your data set is wide with a lot of overlap between potential clusters, then the calculated cluster centers might be very close to each other. In this case, each data point has approximately the same degree of membership in all clusters. To improve your clustering results, decrease this value, which limits the amount of fuzzy overlap during clustering. For an example of fuzzy overlap adjustment, see Adjust Fuzzy Overlap in Fuzzy C-Means Clustering. | 2.0 |
options(2) | Maximum number of iterations, specified as a positive integer. | 100 |
options(3) | Minimum improvement in objective function between two consecutive iterations, specified as a positive scalar. | 1e-5 |
options(4) | Information display flag indicating whether to display the objective function value after each iteration, specified as one of the following:
| true |
If any element of options
is NaN
, the default
value for that option is used.
The clustering process stops when the maximum number of iterations is reached or when the objective function improvement between two consecutive iterations is less than the specified minimum.
Output Arguments
fis
— Fuzzy system
sugfis
object | mamfis
object
Fuzzy system, returned as a FIS object.
The input membership function type is 'gaussmf'
. By default, the
output membership function type is 'linear'
. However, if you specify
type
as 'mamdani'
, then the output membership
function type is 'gaussmf'
.
The following table summarizes the default inference methods.
Inference Method | Default |
---|---|
AND | prod |
OR | probor |
Implication | prod |
Aggregation | sum |
Defuzzification | wtaver |
Version History
Introduced before R2006aR2019b: Support for fuzzy inference system structures will be removed
Support for representing fuzzy inference systems as structures will be removed in a future
release. Use mamfis
and sugfis
objects with
this function instead. To convert existing fuzzy inference system structures to objects, use
the convertfis
function.
This change was announced in R2018b. Using fuzzy inference system structures with this function issues a warning starting in R2019b.
R2017a: To be removed
genfis3
will be removed in a future release. Use genfis
instead. There are differences between these functions that require
updates to your code.
To generate a fuzzy system using grid partitioning, first create a default genfisOptions
set.
opt = genfisOptions('FCMClustering');
You can modify the options using dot notation. Any options you do not modify remain at their default values.
Then, update your code to use genfis
. For example, suppose your
code has the following form.
fis = genfis3(inputData,outputData,type,cluster_n,fcmoptions);
Use the following code instead.
opt = genfisOptions('FCMClustering');
opt.FISType = type;
opt.NumClusters = cluster_n;
opt.Exponent = fcmoptions(1);
opt.MaxNumIteration = fcmoptions(2);
opt.MinImprovement = fcmoptions(3);
opt.Verbose = fcmoptions(4);
fis = genfis(inputData,outputData,opt);
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)