ex_fuzzy.fuzzy_sets.gaussianIVFS#
- class ex_fuzzy.fuzzy_sets.gaussianIVFS(name, secondMF_lower, secondMF_upper, domain, lower_height=1.0)[source]#
Bases:
IVFS
Gaussian Interval-Valued (Type-2) Fuzzy Set Implementation.
This class implements a Gaussian interval-valued fuzzy set with two Gaussian membership functions (upper and lower) representing the uncertainty boundaries. This allows for modeling higher-order uncertainty in fuzzy systems.
Example
>>> lower_params = [5.0, 1.0] >>> upper_params = [5.0, 1.5] >>> iv_gauss = gaussianIVFS(lower_params, upper_params, "Medium", 10) >>> membership = iv_gauss.membership(np.array([4.0, 5.0, 6.0])) >>> print(membership.shape) # (3, 2) - lower and upper bounds
Note
The interval-valued membership function provides both lower and upper bounds for each input, enabling Type-2 fuzzy reasoning.
- __init__(name, secondMF_lower, secondMF_upper, domain, lower_height=1.0)#
Initialize an Interval-Valued Fuzzy Set.
- Parameters:
name (str) – Linguistic name for the fuzzy set
secondMF_lower (list[float]) – Four parameters [a,b,c,d] for lower trapezoidal membership function (outer boundary)
secondMF_upper (list[float]) – Four parameters [a,b,c,d] for upper trapezoidal membership function (inner boundary)
domain (list[float]) – Two-element list [min, max] defining universe of discourse
lower_height (float, optional) – Maximum height of lower membership function. Defaults to 1.0.
- Raises:
AssertionError – If membership function parameters are inconsistent or invalid
Example
>>> ivfs = IVFS("high", [6,7,9,10], [6.5,7.5,8.5,9.5], [0,10], 0.9)
Methods
__init__
(name, secondMF_lower, ...[, ...])Initialize an Interval-Valued Fuzzy Set.
membership
(input)Computes the Gaussian interval-valued membership values for input points.
shape
()Returns the shape of the fuzzy set.
type
()Returns the type of the fuzzy set.
- membership(input)[source]#
Computes the Gaussian interval-valued membership values for input points.
Returns both lower and upper membership bounds for each input value, enabling Type-2 fuzzy set operations.
- Parameters:
input (np.array) – Input values in the fuzzy set domain
- Returns:
Array of shape (n, 2) with [lower, upper] bounds for each input
- Return type:
np.array
Example
>>> iv_gauss = gaussianIVFS([0, 1], [0, 1.5], "Zero", 5) >>> values = iv_gauss.membership(np.array([0.0, 1.0])) >>> print(values.shape) # (2, 2) - 2 inputs, 2 bounds each