Main Content

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.

    Description

    fis = genfis2(inputData,outputData,radii) generates a Sugeno-type FIS object from training data using subtractive clustering. Specify the range of influence of the cluster centers using radii.

    example

    fis = genfis2(inputData,outputData,radii,xBounds) specifies data scale factors for normalizing input and output data into a unit hyperbox.

    example

    fis = genfis2(inputData,outputData,radii,xBounds,options) specifies additional clustering options.

    fis = genfis2(inputData,outputData,radii,xBounds,options,userCenters) specifies custom cluster centers.

    Examples

    collapse all

    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')
    

    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]); 

    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

    collapse all

    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.

    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.

    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.

    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.

    Clustering options, specified as a vector with the following elements.

    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.

    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.

    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.

    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.

    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

    collapse all

    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 MethodDefault
    AND prod
    ORpropor
    Implication prod
    Aggregationmax
    Defuzzificationwtaver

    Version History

    Introduced before R2006a

    expand all

    R2019b: 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.