Generate Fuzzy Inference System structure from data using grid partition
fismat = genfis1(data) fismat = genfis1(data,numMFs,inmftype,outmftype)
genfis1 generates a Sugeno-type FIS structure used as initial conditions (initialization of the membership function parameters) for anfis training.
genfis1(data) generates a single-output Sugeno-type fuzzy inference system using a grid partition on the data.
genfis1(data,numMFs,inmftype,outmftype) generates a FIS structure from a training data set, data, with the number and type of input membership functions and the type of output membership functions explicitly specified.
The arguments for genfis1 are as follows:
data is the training data matrix, which must be entered with all but the last columns representing input data, and the last column representing the single output.
numMFs is a vector whose coordinates specify the number of membership functions associated with each input. If you want the same number of membership functions to be associated with each input, then specify numMFs as a single number.
inmftype is a string array in which each row specifies the membership function type associated with each input. This can be a one-dimensional single string if the type of membership functions associated with each input is the same.
outmftype is a string that specifies the membership function type associated with the output. There can only be one output, because this is a Sugeno-type system. The output membership function type must be either linear or constant. The number of membership functions associated with the output is the same as the number of rules generated by genfis1.
The default number of membership functions, numMFs, is 2; the default input membership function type is 'gbellmf'; and the default output membership function type is 'linear'. These are used whenever genfis1 is invoked without the last three arguments.
The following table summarizes the default inference methods.
Generate a FIS using grid partition.
data = [rand(10,1) 10*rand(10,1)-5 rand(10,1)]; numMFs = [3 7]; mfType = char('pimf','trimf'); fismat = genfis1(data,numMFs,mfType);
To see the contents of fismat, use showfis(fismat).
Plot the FIS input membership functions.
[x,mf] = plotmf(fismat,'input',1); subplot(2,1,1), plot(x,mf); xlabel('input 1 (pimf)'); [x,mf] = plotmf(fismat,'input',2); subplot(2,1,2), plot(x,mf); xlabel('input 2 (trimf)');