ex_fuzzy.fuzzy_sets.categoricalFS#

class ex_fuzzy.fuzzy_sets.categoricalFS(name, category)[source]#

Bases: FS

__init__(name, category)[source]#

Creates a categorical fuzzy set. It gives 1 to the category and 0 to the rest. Use it when the variable is categorical and the categories are known, so that rule inference systems can naturally support both crisp and fuzzy variables.

Parameters:
  • name (str) – string.

  • categories – list of strings. Possible categories.

Methods

__init__(name, category)

Creates a categorical fuzzy set.

membership(x)

Computes the membership of a point or vector of elements.

shape()

Returns the shape of the fuzzy set.

type()

Returns the corresponding fuzzy set type according to FUZZY_SETS enum.

__init__(name, category)[source]#

Creates a categorical fuzzy set. It gives 1 to the category and 0 to the rest. Use it when the variable is categorical and the categories are known, so that rule inference systems can naturally support both crisp and fuzzy variables.

Parameters:
  • name (str) – string.

  • categories – list of strings. Possible categories.

membership(x)[source]#

Computes the membership of a point or vector of elements.

Parameters:

x (array) – input values in the referencial domain.

type()[source]#

Returns the corresponding fuzzy set type according to FUZZY_SETS enum.

__str__()[source]#

Returns the name of the fuzzy set, its type and its parameters.

Returns:

string.

Return type:

str

shape()[source]#

Returns the shape of the fuzzy set.

Returns:

string.

Return type:

str