genfis2
(To be removed) Generate fuzzy inference system from data using subtractive clustering
genfis2
will be removed in a future release. Use genfis
instead. For more information, see Version History.
Syntax
Description
generates a Sugeno-type FIS object from training data using subtractive clustering. Specify
the range of influence of the cluster centers using fis
= genfis2(inputData
,outputData
,radii
)radii
.
specifies data scale factors for normalizing input and output data into a unit
hyperbox.fis
= genfis2(inputData
,outputData
,radii
,xBounds
)
specifies custom cluster centers.fis
= genfis2(inputData
,outputData
,radii
,xBounds
,options
,userCenters
)
Examples
Specify One Cluster Center Range of Influence For All Data Dimensions
Generate an FIS using subtractive clustering, and specify the cluster center range of influence.
Xin = [7*rand(50,1) 20*rand(50,1)-10]; Xout = 5*rand(50,1); fis = genfis2(Xin,Xout,0.5);
fis
uses a range of influence of 0.5
for all
data dimensions.
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')
Specify Cluster Center Range of Influence For Each Data Dimension
Suppose the input data has two columns, and the output data has one column. Specify
0.5
and 0.25
as the range of influence for the
first and second input data columns. Specify 0.3
as the range of
influence for the output data.
Xin = [7*rand(50,1) 20*rand(50,1)-10]; Xout = 5*rand(50,1); fis = genfis2(Xin,Xout,[0.5 0.25 0.3]);
Specify Data Hyperbox Scaling Range
Suppose the input data has two columns, and the output data has one column. Specify the scaling range for the inputs and outputs to normalize the data into the [0 1] range. The ranges for the first and second input data columns and the output data are: [–10, 10], [–5, 5], and [0, 20].
Xin = [7*rand(50,1) 20*rand(50,1)-10]; Xout = 5*rand(50,1); fis = genfis2(Xin,Xout,0.5,[-10 -5 0;10 5 20]);
Here, the third input argument, 0.5
, specifies the range of
influence for all data dimensions. The fourth input argument specifies the scaling range
for the input and output data.
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.
inputData
and outputData
must have the
same number of rows.
radii
— Range of influence of the cluster center
0.5
(default) | scalar value in the range [0
, 1
] | vector
Range of influence of the cluster center for each input and output assuming the data falls within a unit hyperbox.
Scalar value in the range [0, 1] — Use the same influence range for all inputs and outputs.
Vector — Use different influence ranges for each input and output.
Specifying a smaller range of influence usually creates more and smaller data clusters, producing more fuzzy rules.
xBounds
— Data scale factors
array
Data scale factors for normalizing input and output data into a unit hyperbox,
specified as a 2-by-N array, where N is the total
number of inputs and outputs. Each column of DataScale
specifies
the minimum value in the first row and the maximum value in the second row for the
corresponding input or output data set.
When xBounds
is not specified, the genfis2
function uses the minimum and maximum values in the data to be clustered.
options
— Clustering options
vector
Clustering options, specified as a vector with the following elements.
Options(1)
— Squash factor
1.25
(default) | positive scalar
Squash factor for scaling the range of influence of cluster centers, specified as a positive scalar. A smaller squash factor reduces the potential for outlying points to be considered as part of a cluster, which usually creates more and smaller data clusters.
Options(2)
— Acceptance ratio
0.5
(default) | scalar value in the range [0
, 1
]
Acceptance ratio, defined as the fraction of the potential of the first
cluster center above which another data point is accepted as a cluster center,
specified as a scalar value in the range [0
,
1
]. The acceptance ratio must be greater than the rejection
ratio.
Options(3)
— Rejection ratio
0.15
(default) | scalar value in the range [0
, 1
]
Rejection ratio, defined as the fraction of the potential of the first cluster
center below which another data point is rejected as a cluster center, specified
as a scalar value in the range [0
, 1
]. The
rejection ratio must be less than the acceptance ratio.
Options(4)
— Information display flag
false
(default) | true
Information display flag indicating whether to display progress information during clustering, specified as one of the following:
false
— Do not display progress information.true
— Display progress information.
userCenters
— Custom cluster centers
array
Custom cluster centers, specified as a J-by-N array, where J is the number of clusters and N is the total number of inputs and outputs.
Output Arguments
fis
— Fuzzy inference system
sugfis
object
Fuzzy inference system, returned as a sugfis
object.
The input membership function type is 'gaussmf'
, and the output
membership function type is 'linear'
.
The following table shows the default inference methods for this fuzzy system.
Inference Method | Default |
---|---|
AND | prod |
OR | propor |
Implication | prod |
Aggregation | max |
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
genfis2
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('SubtractiveClustering');
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 = genfis2(inputData,outputData,radii,xBounds,options,userCenters);
Use the following code instead.
opt = genfisOptions('SubtractiveClustering');
opt.ClusterInfluenceRange = radii;
opt.DataScale = xBounds;
opt.SquashFactor = options(1);
opt.AcceptRatio = options(2);
opt.RejectRatio = options(3);
opt.Verbose = options(4);
opt.CustomClusterCenters = userCenters;
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 (한국어)