Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Lecture 5:

Automated Methods:
Learning from Example

By
Assoc. Prof. Ts. Dr. Choo Yun Huoy
Department of Intelligent Computing & Analytics
Faculty of Information and Communication Technology
Univ. Teknikal Malaysia Melaka (UTeM)
Hang Tuah Jaya, 76100 Durian Tunggal, Melaka, Malaysia.
huoy@utem.edu.my
Example of Automated Methods
(A) Fuzzy Modelling Method
— Clustering method (CM)
— Learning from example (LFE)
— Modified learning from example (MLFE)

(B) Refining Methods


— Gradient method (GM)
— Batch least squares (BLS)
2 — Recursive least squares (RLS)
An Example of Fuzzy System
— 2 inputs : x1 & x2 1 output : y
can be extended to multiple-
— Typical example of a rule: input, multiple output

◦ IF premise1 and premise2 THEN consequence


— Incorporate Gaussian and triangular membership function for input
μ(xi)

σi
0 ci xi
Gaussian MF
μ(xi)

σi
0 ci xi
Triangular MF
◦ xi is the ith input variable
◦ ci is the ith center of the membership function
3 ◦ σi is a constant related to the spread of the ith membership function.
An Example of Fuzzy System
μ(yi)
— Delta functions for output 1
◦ An impulse function of zero width with only
1 value with full membership located at bi. .
0 bi xi
Delta MF
— Center-average defuzzification, product t-norm (fuzzy intersection) for
premise and product implication ( ) are used.
— Output prediction equation:

◦ R = number of rules in rule-base


◦ n = number of inputs per data tuple
4 ◦ θ = vector that includes the MF parameters for the rule-base, ci, σi , and bi.
An Example of Fuzzy System
— Training data set Z={([x1, x2], y)}
Table 1
x1 x2 y
0 2 1
2 4 5
3 6 6

— The data are used to train the fuzzy system to model the output y given the
two inputs x1,dan x2

5
x1
Table 1
x2 y
Learning from Example
0 2 1
— LFE relies entirely on a complete specification of membership
2 4 5
functions by the analyst as it only constructs the rules.
3 6 6

— From training data in Table 1:

— Define expected range of variation in the input and output


variables:
◦ Xi = [xi-, xi+], i = 1, 2, Y = [y-, y+]

◦ x1- = 0 x1+= 4 x2- = 0 x2+ = 8 y- = -1 y+ = 9

— The triangular MF can be rewritten as:

◦ u is the point of interest


◦ C is the membership function center
6 ◦ 𝝎 is the base width of the MF
x1
Table 1
x2 y
Learning from Example
0 2 1
— Now, define the membership function of each input and output
2 4 5
universe of discourse, figure 7.8-7.10.
3 6 6

7
x1
Table 1
x2 y
Learning from Example
0 2 1
— Now, define the membership function of each input and output
2 4 5
universe of discourse, figure 7.8-7.10.
3 6 6

8
x1
Table 1
x2 y
Learning from Example
0 2 1
— The number of MF on each universe of discourse affects the
2 4 5
accuracy of the function approximations.
3 6 6

— In the example, value of input 1 < input 2. As in figure 7.8 & 7.9.
Both are saturated and the far left & right extremes.

— Determine the membership values of these extreme ends with the


following MFs:

9
x1
Table 1
x2 y
Learning from Example
0 2 1
— First data tuple:
2 4 5
3 6 6 ◦ Add to rule-base since no current rule
◦ Rule 1 : IF x1 is X11 and x2 is X32 THEN y is Y1

— Degree of attainment:

◦ degree(R1)= 1*1*1=1

10
x1
Table 1
x2 y
Learning from Example
0 2 1
— Second data tuple:
2 4 5
3 6 6 ◦ Consider adding another rule to rule-base since existing rule does not
model tuple 2.
◦ Rule 2 : IF x1 is X31 and x2 is X52 THEN y is Y3
◦ degree(R1)= 0*0*0=0 (zero membership in Rule 1)
◦ degree(R2)= 1*1*1=1 (full membership in Rule 2)

Thus Rule 2 is added in the rule-based

11
x1
Table 1
x2 y
Learning from Example
0 2 1 — Third data tuple:
2 4 5
◦ Consider adding another rule to rule-base since existing rule does not model
3 6 6 tuple 3.
◦ Rule 3 : IF x1 is X41 and x2 is X72 THEN y is Y3
◦ degree(R1)= 0*0*0=0 (zero membership in Rule 1)
◦ degree(R2)= 0*0*0.5=0 (zero membership in Rule 2)
◦ degree(R3)= 1*1*0.5=0.5(partial membership in Rule 3)

Thus Rule 3 is added in the rule-based

12
x1
Table 1
x2 y
Learning from Example
0 2 1
Finally, we have :
2 4 5
3 6 6 Rule 1 : IF x1 is X11 and x2 is X32 THEN y is Y1

Rule 2 : IF x1 is X31 and x2 is X52 THEN y is Y3

Rule 3 : IF x1 is X41 and x2 is X72 THEN y is Y3

• Ideally not prefer specific rule for each data-tuple.


• Some rules may adequately represent more than one
data pairs.
• Else, the fuzzy membership set may be designated
differently to avoid adding unnecessary rules to the rule-
base.

13

You might also like