Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 36 ยท Fuzzy Inference

Sugeno Inference (Takagi-Sugeno-Kang)

Learn Takagi-Sugeno-Kang fuzzy inference: rules with constant or linear consequents, weighted-average output, approximating a nonlinear function with local models, and fitting consequents by least squares.

Mamdani inference produces a fuzzy set that must be defuzzified. In 1985 Takagi and Sugeno (and later Kang) proposed a shortcut: let each rule's consequent be a number or a formula directly. There is no output set and no defuzzification step: the final answer is simply the weighted average of the rule outputs, with the firing strengths as weights. The result is cheaper to compute, always smooth, and well suited to control and to learning from data. This lesson explains the two orders of Sugeno systems and shows how to fit one to a nonlinear function.

The rule format

A Sugeno rule has fuzzy sets in the antecedent, as usual, but a function of the inputs in the consequent:

TEXT
IF x is A AND y is B THEN z = f(x, y)
  • Zero-order Sugeno: f is a constant, z = k. Each rule says "in this situation, output k".
  • First-order Sugeno: f is linear, z = p*x + q*y + r. Each rule is a small local linear model that is valid where its antecedent is true.

The output formula

If rule i has firing strength w_i and consequent value z_i, the system output is

TEXT
z = ( sum of w_i * z_i ) / ( sum of w_i )

It is a weighted average, so it is automatically smooth, and it always lies between the smallest and largest z_i. The denominator normalises the weights; if all w_i are zero, no rule applies and the output is undefined, so check coverage as you would for any fuzzy system (see Fuzzification).

flowchart LR
    X["Inputs x, y"] --> W["Firing strengths<br/>w1, w2, w3"]
    X --> Z["Rule outputs<br/>z1 = f1(x, y) ..."]
    W --> A["Weighted average<br/>sum(w z) / sum(w)"]
    Z --> A
    A --> O["Crisp output"]

Sugeno inference skips the output set: the average of rule outputs is already crisp.

A zero-order example

A simple cooling fan: input is the room temperature; three rules give constant fan speeds in percent.

Python A zero-order Sugeno fan controller

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The output moves smoothly between 10 and 100. The constants act like "anchor points", and the fuzzy memberships interpolate between them. In effect a zero-order Sugeno system is a smooth lookup table.

First-order: blending local linear models

With linear consequents, each rule is a local model, and the fuzzy system blends them. This is a powerful way to represent a nonlinear function with simple pieces: "near x = 0.5 the function looks like this line, near x = 2 like that line, near x = 3.5 like a third line".

Let us approximate y = x^2 on the interval 0 to 4 with three rules whose consequents are the tangent lines of the parabola at x = 0.5, 2 and 3.5 (the tangent at c is y = 2c*x - c^2).

Python Approximating x squared with three local lines

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Three rules and six numbers follow the parabola to within about 0.56 on an interval where the values climb to 16 (the lines lie below the curve between their touching points). More rules mean smaller error. This kind of model is also called a Takagi-Sugeno model and is the basis of "gain scheduling" and many nonlinear control methods: each local linear model can be analysed with ordinary linear tools, and the fuzzy memberships hand over smoothly from one to the next.

Learning the consequents from data

A beautiful property: once you fix the antecedents (the shapes and positions of the terms), the output is linear in the consequent parameters p, q, r. So you can fit them directly from data by ordinary least squares, with no iterative training. Each data point gives one equation, in which the unknowns are multiplied by the normalised firing strengths.

Python Fitting first-order consequents by least squares

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The four local lines follow the sine wave closely (error near the noise level of 0.05), while a single global straight line cannot. This least-squares idea is also the first half of the ANFIS algorithm (adaptive neuro-fuzzy inference system), which uses gradient descent for the antecedent shapes and least squares for the consequents.

Mamdani or Sugeno?

Mamdani Sugeno
Rule consequent Fuzzy set Constant or linear function
Output computation Aggregate sets, defuzzify Weighted average
Speed Slower Faster
Readability for experts Very natural wording Good for engineers, less linguistic
Learning from data Harder Easy (least squares, ANFIS)
Output smoothness Depends on defuzzifier Smooth by construction

Use Mamdani when the rules come from human experts and need to be read and discussed. Use Sugeno when you tune from data, need speed or want analysable local models. The two can even be mixed in one project: prototype with Mamdani, then convert to Sugeno for deployment.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does the consequent of a first-order Sugeno rule look like?

    First-order means the consequent is linear in the inputs; zero-order uses a constant.
  2. 2. How is the output of a Sugeno system computed?

    z = sum(w_i * z_i) / sum(w_i).
  3. 3. Why can consequent parameters be fitted with plain least squares?

    With fixed firing strengths each prediction is a linear combination of the unknown p, q, r, so lstsq solves it directly.
  4. 4. A Sugeno system has all firing strengths equal to 0 for some input. What happens?

    The weighted average divides by the sum of weights, which would be 0.
  5. 5. When might you prefer Mamdani over Sugeno?

    Mamdani consequents are linguistic terms, which makes the rule base easy to discuss with a domain expert.

Summary

  • Sugeno rules have constant (zero-order) or linear (first-order) consequents.
  • The output is the weighted average of the rule outputs, so there is no defuzzification step.
  • First-order systems blend local linear models, approximating nonlinear functions smoothly.
  • Consequent parameters are linear unknowns and can be fitted by least squares; ANFIS builds on this.
  • Choose Mamdani for readability, Sugeno for speed, smoothness and data-driven tuning.

Next: Defuzzification Methods