# genfisOptions

Option set for `genfis`

function

## Description

creates a default options object for generating a fuzzy inference system using
`opt`

= genfisOptions(`clusteringType`

)`genfis`

. The options object,
`opt`

, contains different options that depend on the
specified clustering algorithm, `clusteringType`

. Use dot
notation to modify this option set for your specific application. Options that you
do not modify retain their default values.

creates
an option set with options specified by one or more `opt`

= genfisOptions(`clusteringType`

,`Name,Value`

)`Name,Value`

pair
arguments.

## Examples

### Specify Options for FIS Generation

Create a default option set for the grid partitioning generation method.

`opt = genfisOptions("GridPartition");`

Modify the options using dot notation. For example, specify `3`

membership functions for the first input and `4`

membership functions for the second input.

opt.NumMembershipFunctions = [3 4];

You can also specify options when creating the option set. For example, create an option set for FCM clustering using `4`

clusters.

opt2 = genfisOptions("FCMClustering","NumClusters",4);

## Input Arguments

`clusteringType`

— Clustering method

`"GridPartition"`

| `"SubtractiveClustering"`

| `"FCMClustering"`

Clustering method for defining membership functions and fuzzy rules, specified as one of the following:

`"GridPartition"`

— Generate input membership functions by uniformly partitioning the input variable ranges, and create a single-output Sugeno fuzzy system. The fuzzy rule base contains one rule for each input membership function combination.`"SubtractiveClustering"`

— Generate a Sugeno fuzzy system using membership functions and rules derived from data clusters found using subtractive clustering of input and output data. For more information on subtractive clustering, see`subclust`

.`"FCMClustering"`

— Generate a fuzzy system using membership function and rules derived from data clusters found using FCM clustering of input and output data. For more information on FCM clustering, see`fcm`

.

### Name-Value Arguments

Specify optional pairs of arguments as
`Name1=Value1,...,NameN=ValueN`

, where `Name`

is
the argument name and `Value`

is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.

*
Before R2021a, use commas to separate each name and value, and enclose*
`Name`

*in quotes.*

**Example: **```
opt =
genfis("GridPartition",NumMembershipFunctions=3)
```

*
Before R2021a, use commas to separate each name and value, and enclose*
`Name`

*in quotes.*

**Example: **```
opt =
genfis("GridPartition","NumMembershipFunctions",3)
```

**Grid Partitioning Options**

`NumMembershipFunctions`

— Number of input membership functions

`2`

(default) | integer greater than 1 | vector of integers greater than 1

Number of input membership functions for each input variable, specified as one of the following values.

Integer greater than 1 — Specify the same number of membership functions for all inputs.

Vector of integer greater than 1 with length equal to the number of inputs — Specify a different number of membership functions for each input.

`InputMembershipFunctionType`

— Input membership function type

`'gbellmf'`

(default) | `'gaussmf'`

| `'trimf'`

| `'trapmf'`

| character vector | string array | ...

Input membership function type, specified as one of the following values.

Character vector or string — Specify one of the following membership function types for all inputs.

Membership function type Description For more information `"gbellmf"`

Generalized bell-shaped membership function `gbellmf`

`"gaussmf"`

Gaussian membership function `gaussmf`

`"gauss2mf"`

Gaussian combination membership function `gauss2mf`

`"trimf"`

Triangular membership function `trimf`

`"trapmf"`

Trapezoidal membership function `trapmf`

`"dsigmf"`

Difference between two sigmoidal membership functions `dsigmf`

`"psigmf"`

Product of two sigmoidal membership functions `psigmf`

`"pimf"`

Pi-shaped membership function `pimf`

Character array or string array — Specify a different membership function type for each input. For example, specify different membership functions for a three-input system.

["gbellmf","gaussmf","trimf"]

`OutputMembershipFunctionType`

— Output membership function type

`"linear"`

(default) | `"constant"`

Output membership function type for a single-output Sugeno system, specified as one of the following values.

`"linear"`

— The output of each rule is a linear function of the input variables, scaled by the antecedent result value.`"constant"`

— The output of each rule is a constant, scaled by the antecedent result value.

**Subtractive Clustering Options**

`ClusterInfluenceRange`

— 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, specified as one of the following values.

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.

`DataScale`

— Data scale factors

`"auto"`

(default) | 2-by-*N* 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 `DataScale`

is `"auto"`

, the
`genfis`

command uses the actual minimum and maximum values in
the data to be clustered.

`SquashFactor`

— 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.

`AcceptRatio`

— Acceptance ratio

`0.5`

(default) | scalar value in the range [`0`

, `1`

]

Acceptance ratio, defined as a 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.

`RejectRatio`

— Rejection ratio

`0.15`

(default) | scalar value in the range [`0`

, `1`

]

Rejection ratio, defined as a 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 acceptance ratio.

`Verbose`

— Information display flag

`false`

(default) | `true`

Information display flag indicating whether to display progress information during clustering, specified as one of the following values.

`false`

— Do not display progress information.`true`

— Display progress information.

`CustomClusterCenters`

— Custom cluster centers

`[]`

(default) | *C*-by-*N* array

Custom cluster centers, specified as a *C*-by-*N* array,
where *C* is the number of clusters and
*N* is the total number of inputs and
outputs.

**FCM Clustering Options**

`FISType`

— Fuzzy inference system type

`"sugeno'`

(default) | `"mamdani"`

Fuzzy inference system type, specified as one of the following values.

`"sugeno"`

— Sugeno-type fuzzy system`"mamdani"`

— Mamdani-type fuzzy system

For more information on the types of fuzzy inference systems, see Mamdani and Sugeno Fuzzy Inference Systems.

`NumClusters`

— Number of clusters

`"auto"`

(default) | integer greater than `1`

Number of clusters to create, specified as `"auto"`

or an integer greater
than `1`

. When `NumClusters`

is
`"auto"`

, the `genfis`

command
estimates the number of clusters using subtractive clustering with a
cluster influence range of `0.5`

.

`NumClusters`

determines the number of rules
and membership functions in the generated FIS.

`Exponent`

— Exponent for fuzzy partition matrix

`2.0`

(default) | scalar greater than `1.0`

Exponent for the fuzzy partition matrix, specified as a scalar greater than
`1.0`

. This option controls the amount of fuzzy overlap between
clusters, with larger values indicating a greater degree of overlap.

If your data set is wide with significant overlap between potential clusters, then the calculated cluster centers can 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.

`MaxNumIteration`

— Maximum number of iterations

`100`

(default) | positive integer

Maximum number of iterations, specified as a positive integer.

`MinImprovement`

— Minimum improvement in objective function

`1e-5`

(default) | positive scalar

Minimum improvement in objective function between two consecutive iterations, specified as a positive scalar.

`Verbose`

— Information display flag

`true`

(default) | `false`

Information display flag indicating whether to display the objective function value after each iteration, specified as one of the following values.

`true`

— Display objective function.`false`

— Do not display objective function.

`DistanceMetric`

— Method for computing distance

`"euclidean"`

(default) | `"mahalanobis"`

Method for computing distance between data points and cluster centers, specified as one of the following values.

`"euclidean"`

— Compute distance using a Euclidean distance metric, which corresponds to the classical FCM algorithm.`"mahalanobis"`

— Compute distance using a Mahalanobis distance metric, which corresponds to the Gustafson-Kessel FCM algorithm.

## Output Arguments

`opt`

— Options for `genfis`

function

`GridPartitionOptions`

object | `SubtractiveClusteringOptions`

object | `FCMClusteringOptions`

object

Options for `genfis`

function, returned as one of the
following objects.

`GridPartitionOptions`

— When`clusteringType`

is`"GridPartition"`

`SubtractiveClusteringOptions`

— When`clusteringType`

is`"SubtractiveClustering"`

`FCMClusteringOptions`

— When`clusteringType`

is`"FCMClustering"`

## Version History

**Introduced in R2017a**

## Open Example

You have a modified version of this example. Do you want to open this example with your edits?

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