Mamdani inference¶
Mamdani consequents are fuzzy sets
(output is term). For each call:
- Evaluate every rule's antecedent → a firing strength.
- Shape the consequent set over the output universe via the implication
operator (
minclips,prodscales). - Aggregate shaped sets per output variable (s-norm, default
max). - Defuzzify to a crisp value.
import fuzzytool as fz
sys = fz.Mamdani(
tnorm="min", snorm="max", # antecedent connectives
implication="min", # "min" (clip) or "prod" (scale)
aggregation="max", # combine shaped output sets
defuzz="centroid", # see the defuzzification guide
)
Multiple outputs¶
Add rules whose consequents reference different output variables; calling the
system returns a dict keyed by output name (a single output returns a float).