Products & Services Solutions Academia Support User Community Company

Learn more about Fuzzy Logic Toolbox   

genfis2 - Generate Fuzzy Inference System structure from data using subtractive clustering

Syntax

fismat = genfis2(Xin,Xout,radii) 
fismat = genfis2(Xin,Xout,radii,xBounds) 
fismat = genfis2(Xin,Xout,radii,xBounds,options) 
fismat = genfis2(Xin,Xout,radii,xBounds,options,user_centers)

Description

genfis2 generates a Sugeno-type FIS structure using subtractive clustering and requires separate sets of input and output data as input arguments. When there is only one output, genfis2 may be used to generate an initial FIS for anfis training. genfis2 accomplishes this by extracting a set of rules that models the data behavior.

The rule extraction method first uses the subclust function to determine the number of rules and antecedent membership functions and then uses linear least squares estimation to determine each rule's consequent equations. This function returns a FIS structure that contains a set of fuzzy rules to cover the feature space.

The arguments for genfis2 are as follows:

The default input membership function type is 'gaussmf', and the default output membership function type is 'linear'.

The following table summarizes the default inference methods.

Inference MethodDefault
AND prod
ORprobor
Implicationprod
Aggregationmax
Defuzzificationwtaver

Examples

Example 1

The following example uses the genfis2 function with the minimum number of arguments and generates a FIS with default values. In this case, a range of influence of 0.5 is specified for all data dimensions.

Xin1 =  7*rand(50,1);
Xin2 = 20*rand(50,1)-10;
Xin  = [Xin1 Xin2];
Xout =  5*rand(50,1);
fismat = genfis2(Xin,Xout,0.5);

showfis(fismat) displays the contents of each field of the structure fismat.

To plot the input membership functions, type

[x,mf] = plotmf(fismat,'input',1);
subplot(2,1,1), plot(x,mf);
xlabel('Membership Functions for input 1');
[x,mf] = plotmf(fismat,'input',2);
subplot(2,1,2), plot(x,mf);
xlabel('Membership Functions for input 2');

Example 2

The following example assumes the combined data dimension is 3. Suppose Xin has two columns and Xout has one column, then 0.5 and 0.25 are the ranges of influence for each of the Xin data dimensions, and 0.3 is the range of influence for the Xout data dimension.

Xin1 =  7*rand(50,1);
Xin2 = 20*rand(50,1)-10;
Xin  = [Xin1 Xin2];
Xout =  5*rand(50,1);
fismat = genfis2(Xin,Xout,[0.5 0.25 0.3])

Example 3

The following example specifies how to normalize the data in Xin and Xout into values in the range [0 1] for processing. Suppose Xin has two columns and Xout has one column, then the data in the first column of Xin are scaled from [-10 +10], the data in the second column of Xin are scaled from [-5 +5], and the data in Xout are scaled from [0 20].

Xin1 =  7*rand(50,1);
Xin2 = 20*rand(50,1)-10;
Xin  = [Xin1 Xin2];
Xout =  5*rand(50,1);
fismat = genfis2(Xin,Xout,0.5,[-10 -5 0; 10 5 20])

See Also

subclust, genfis1, genfis3, anfis

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS