scikit-fuzzy is an fuzzy logic Python package that works with
numpy arrays. The package is imported as
>>> import skfuzzy
though the recommended import statement uses an alias:
>>> import skfuzzy as fuzz
Most functions of
skfuzzy are brought into the base package namespace.
You can introspect the functions available in
fuzz when using IPython by:
 import skfuzzy as fuzz  fuzz.
and pressing the Tab key.
A list of submodules and functions is found on the API reference webpage.
scikit-fuzzy, universe variables and fuzzy membership functions are
numpy arrays. Generation of membership functions is
as simple as:
>>> import numpy as np >>> import skfuzzy as fuzz >>> x = np.arange(11) >>> mfx = fuzz.trimf(x, [0, 5, 10]) >>> x array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) >>> mfx array([ 0. , 0.2, 0.4, 0.6, 0.8, 1. , 0.8, 0.6, 0.4, 0.2, 0. ])
While most functions are available in the base namespace, the package is factored with a logical grouping of functions in submodules. If the base namespace appears overwhelming, we recommend exploring them individually. These include
scikit-fuzzy, containing the majority of the most common fuzzy logic operations.