Fuzzy Rule Based Models
Fuzzy Rule Based Models
Models
• Example
– sets
– rough sets
– fuzzy sets
i = 1, 2,..., c
Ai on Xi, i = 1, 2,...,n
Bj on Yj, j = 1, 2,...,m
If X is A and Y is B then Z is C
µ ∈[0,1]
µ = 1 rule is certain
• Examples:
• If X is Ai then y = f (x,ai)
f:X→Y
x∈Rn
Main steps:
Output Interface
Rule Data
Input Interface
Base Base
X Y
Fuzzy
Inference
fuzzy set
x (°C)
Pedrycz and Gomide, FSE 2007
Multiple fuzzy inputs: conjunctive canonical form
Ai : fuzzy sets on Xi
i = 1, 2, ..., n
n
P( x1 , x2 ,K , xn ) = A1 ( x1 )tA2 ( x2 )t KtAn ( xn ) = T Ai ( xi ) t (T) = t-norm
i =1
(b) Contours of P
20
y
P
10
0
0 5 x 10
Ai : fuzzy sets on Xi
i = 1, 2, ..., n
n
Q( x1 , x2 ,K , xn ) = A1 ( x1 ) sA2 ( x2 ) s K sAn ( xn ) = S Ai ( xi ) s (S) = t-conorm
i =1
(d) Contours of Q
20
y
Q
10
0
0 5 x 10
f : [0,1]2 → [0,1]
• In general f can be
– fuzzy conjunction: ft
– fuzzy disjunction: fs
– fuzzy implication: fi
Examples:
• t = min
• t = algebraic product
Examples:
• s = max
• s = Lukasiewicz t-conorm
1 − A( x) + (λ + 1) B( y )
Pseudo-Lukasiewicz f λ ( A( x) , B( y )) = min 1, λ > -1
1 + λA( x)
1 if A( x) ≤ B( y )
Gaines f a ( A( x) , B( y )) =
0 otherwise
1 if A( x) ≤ B( y )
Gödel f g ( A( x) , B ( y )) =
B( y) otherwise
1 if A( x) ≤ B ( y )
B( y )
Goguen f e ( A( x) , B( y )) =
otherwise
A( x)
Kleene
f b ( A( x) , B( y )) = max [1 − A( x) , B ( y )]
Reichenbach f r ( A( x) , B( y )) = 1 − A( x) + A( x) B( y )]
Klir-Yuan f k ( A( x) , B( y )) = 1 − A( x) + A( x) 2 B( y )
1. s-implications
fis ( A( x), B ( y )) = A ( x) sB ( y ) ∀( x , y ) ∈ X × Y
2. r-implications
t = min
1 if A( x) ≤ B ( y )
f g ( A( x), B ( y )) = Gödel
B( y ) A( x) > B( y )
B(y)
1.0 1.0
A(x)
BRd
x y
0.8
0.6
0.4
0.2
0
1
B(y) 1
0.8 A(x)
0.5 0.6
0.4
0.2
0 0
Rd(x,y) Rd (x,y)
∀ (A(x), B(y))∈[0,1]2 A(x) = A(x,3,5,7)
B(y) = B(y,3,5,7)
Pedrycz and Gomide, FSE 2007
Main types of rule bases
1. fuzzy graph
• R = R1 or R2 or....or RN
• general form
N
R( x, y ) = S [ Ai ( x)tBi ( y )]
i=1
(a) (b)
10 10
8 8
6 6
y P
4 B 4
2 2
Point P in X×Y
0 0
1 B(y) 0 0 2 4 6 8 x 10 P = A×B
(c) A is a singleton in X
1 B is a singleton in Y
A
A(x)
0
0 2 4 6 8 x 10
(a) (b)
10 10
8 8
B G
6 6
y
4 4
2 2
0 0 Granule G in X×Y
1 B(y) 0 0 2 4 6 8 x 10
(c)
G = A×B
A is an interval in X
1
A
B is an interval in Y
A(x)
0
0 2 4 6 8 x 10
8 8 R
6 B 6
y
4 4
2 2
0 0
fuzzy granule R in X×Y
1 0 0 5 x 10
B(y)
(c)
R = A×B
A is a fuzzy set on X
1
A B is a fuzzy set on Y
A(x)
0
0 2 4 6 8 x 10
8 R1
8
B1 R2
7
B2
6 6 R3
B3
5 R4
B4
4 4 R5
B5
3
2
2
1
0
1 0 0
B(y)
0 1 2 3 4 5 6 7 8 9 x 10
(c)
A1 A2 A3 A4 A5
Ri = Ai×Bi
0
0 2 4 6 8 x 10
y
y
11
10 10
9
R1
Ri = Ai×Bi
8 8 R2
7
6 R3
6
R4
5
f
4 4 R5 R6
R7
3 R R8
2 2
1
0
0 2 4 6 8 10 x 12 1 2 3 4 5 6 7 8 9 10 11 x 12
f R
7
R = Union Ri
6
0
0 1 2 3 4 5 6 7 8 9 x 10
7
R = Union Ri
6
0
0 1 2 3 4 5 6 7 8 9 x 10
• R = R1 and R2 and....and RN
• general form
N
R = T fi ( Ai ( x) , Bi ( y ))
i=1
8 8
6 B 6
R
y
4 4
2 2
0
1 B(y) 0
0
0 2 4 6 8 x 10 fuzzy rule R in X×Y
(c) R = fl (A,B)
1 Lukasiewicz implication
A
A(x)
0
0 2 4 6 8 x 10
y
4
0
0 1 2 3 4 5 6 7 8 9 10
x
y
4
0
0 1 2 3 4 5 6 7 8 9 10
x
y
9
0
0 1 2 3 4 5 6 7 8 9 x 10
y
9
0
0 1 2 3 4 5 6 7 8 9 x 10
• Granulation
– granular constructs in the form of fuzzy points
– granules along different regions of the universes
X X
(a)
12
x=a
y
ac
10
y = f (x)
8
y=b
b I
4 b = ProjY (ac ∩ f )
f
2
⇓
0
0 2 a 4 6 8 10 12
b = ProjY ( I )
x
(b)
12
x=A
y
10 Ac
y = f (x)
8
B = f (A) ={f (x), x∈A}
B = ProjY (Ac ∩ f )
I
4 B
c
f
2
⇓
A
0
0 2 a 4 b 6 8 10 x 12
B = ProjY ( I )
(a)
12
x is A
y
10 Ac
(x,y) is R
8
y is B
6
B
I
4
B = ProjY (Ac ∩ R )
R f
2
⇓
A
0
0 2 4 6 8 10 x 12
B = ProjY ( I )
(b)
12
y
Ac
10
8
X is A (fuzzy set on X)
6 B
I
R
(X,Y) is R (fuzzy relation on X×Y)
Y is B (fuzzy set on Y)
4
f
2
2 4 6 8 10 x 12
B = ProjY (Ac ∩ R )
⇓
B ( y ) = sup { A( x )tR ( x , y )}
B = ProjY ( I ) ⇒ x∈X
X is A
(X,Y) is R
Y is B
B = Ao R
X is A
(X,Y) is R
Y is AoR
P: X is A and Y is B input
Z: Z is C output
Assume
i = 1,..., N
N
C = P o R = P o U Ri
i =1
Ci′ = P o Ri
Initialization C = ∅
for i = 1: N do
mi = max (min (A, Ai))
ni = max (min (B, Bi))
λi = min (mi, ni)
if λi ≠ 0 then Ci’ = min (λi , Ci) and C = max(C, Ci’)
return C
Ai Aj A Bi B Bj Ci Cj
1 1 1
mj
nj Cj’
nj
ni Ci’
mi mi
x y z
A1,B1 C1
Ai,Bi Ci
C
(A,B) Poss λi Min Max
Ci’
AN,BN CN
1 if x = xo 1 if y = yo
A( x) = and B ( y ) =
0 otherwise 0 otherwise
Numeric output
∫ zC ( z )dz
z= Z centroid defuzzification
∫Z C ( z )dz
N
∑ (mi ∧ ni )vi
z = i =1 weighted average modal values vi
N
∑ (mi ∧ ni )
i =1
N = 2, centroid defuzzification
0.5
0.5
0
z
-2 -1.5 -1 -0.5 0 0.5 1 1.5 x 2
0
B2 B2
1
-0.5
Bi(y)
0.5
0 -2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 y 2
y
C1 C2 -1
1
0
Ci(z)
0.5
x -2
1 -1
0
0 1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 z 2 2
2
Assume
i = 1,..., N
Ci′ ( z ) = sup[ A( x ) ∧ B ( y ) ∧ Ai ( x) ∧ Bi ( y ) ∧ Ci ( z )]
x ,y
Additive fuzzy models
N (Kosko, 1992)
C ( z) = ∑ wiCi′
i =1
Ai Aj A Bi B Bj Ci Cj
1 1 1
mj ∑Ci’
nj nj
ni Ci’ Cj’
mi mi
x y z
A1,B1 C1
Ai,Bi Ci w1
wi C
(A,B) Poss λi Min ∑
Ci’
AN,BN CN
wN
1 A1 A2
Ai(x)
0.5
0.5
0
z
-2 -1.5 -1 -0.5 0 0.5 1 1.5 x 2
0
1
B2 B2
-0.5
Bi(y)
0.5
0 -2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 y 2
y
C1 C2 -1
1
0
Ci(z)
0.5
x -2
1 -1
0
0 1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 z 2 2
2
Ci′ ( z ) = mi ni Ci ( z ) 0.5
z
0
-0.5
N
C ( z ) = S p Ci′ ( z ) -2
y
i =1
-1
x -2
1 -1
0
2 1
2
0.5
Ci′ ( z ) = mi ni Ci ( z )
z
0
-0.5
N -2
C ( z ) = ∑ Ci′ ( z )
y
-1
i =1 0
x -2
1 -1
0
2 1
2
Ci′ ( z ) = mi ⊗ ni ⊗ Ci ( z )
(c) Input-output mapping of bounded product-bounded sum model
1
N
z
C ( z ) = ⊕ Ci′ ( z )
0.5
i =1 0
-0.5
a ⊗ b = max{0 , a + b − 1} -1
-2
y
a ⊕ b = min{1, a + b} -1
0
-2
1 -1 x
a,b ∈ [0 ,1] 2 1
0
2
P: X is x and Y is y input
N λi
z = ∑ wi ( x , y ) fi ( x , y ) , wi =
N output
i =1
∑ λi ( x , y )
i =1
A1,B1 f1(x,y)
w1
⊗ ×
Ai,Bi f2(x,y)
wi z
(x,y) ⊗ × ∑
AN,BN fN(x,y)
wN
⊗ ×
R1: If X is A1 then z = x
rules
R2: If X is A2 then z = – x + 3
A1 A2
y
1 2.5
0.8 2 f2 f1
0.6 1.5
0.4 1
0.2 0.5
0 0
0 0.5 1 1.5 2 2.5 x 3 0 0.5 1 1.5 2 2.5 x 3
1.8
1.6
1.4
1.2
1
output
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 x 3
y y
A1 A2 A3
1 1
0.8 0.5
0.6 0
0.4 -0.5
0.2 -1
0 -1.5
-5 -4 -3 -2 -1 0 1 2 3 4 x 5 -5 -4 -3 -2 -1 0 1 2 3 4 x 5
R1: If X is A1 then y = – 1
R3: If X is A3 then y = 1
output
(a) Antecedent fuzzy sets (c) output of the functional fuzzy model
1.2 1.5
y
y
A1 A2 A3
1 1
0.8 0.5
0.6 0
0.4 -0.5
0.2 -1
0 -1.5
-5 -4 -3 -2 -1 0 1 2 3 4 x 5 -5 -4 -3 -2 -1 0 1 2 3 4 x 5
i = 1,..., N
1 if Ci ( z ) ≥ Ai ( x)
Ri ( x, y ) =
0 otherwise
N N
C = I (Ci′ ) αi = I Cαi
i =1 i =1
A1 C1
Ai Ci
C
x Poss αi Cα1 Min
Ci’
AN CN
A1 A2 C1 C2
1 1
α1 α1
C1’ C2’
α2 α2
x z
output
4
A1 A2
1
z
0.8
3.5
0.6
Ai
0.4
0.2 3
0
1 1.5 2 2.5 3 3.5 x 4
2.5
C1 C2
1 2
0.8
0.6
Ci
1.5
0.4
0.2
0 1
1 1.5 2 2.5 3 3.5 z 4 1 1.5 2 2.5 3 3.5 x 4
(additive models)
+ e Fuzzy u y
r Process
− Controller
r
e
t
Change of Error (de) / Error (e) NM NS ZE PS PM
NB PM NB NB NB NM
NM PM NB NS NM NM
NS PM NS Z NS NM
Z PM NS Z NS NM
PS PM PS Z NS NM
PM PM PM PS PM NM
PB PM PM PM PM NM
v3 v2
R4 R1
v4 v1
y y y
x x x
• Ri: If Xi1 is Ai1 and ... and Xin is Ain then z = aio + ai1x1 + ....+ ainxn
i = 1,..., N
a1 a1
[ ]
a a
a= 2 ŷk = z1Tk zT
2k L z Nk 2
T
M M
a a
N N
and
ŷ1 zT T
z12 L z TN1
ŷ 11
T
z12 zT L zN2T
y= 2 Z = 22
M
ŷ M M O M
M z T zT L z TNM
1M 2M
then y = Za
Solution
aopt = Z# y
Z# = (ZT)–1ZT
zT
i1
T
z
Zi = i 2
M
T
z iM
Solution
aiopt = Zi# y
Zi# = (ZiT)–1ZiT
consistency
data completeness
accuracy
rules
• Rules in conflict
– similar or same conditions
– completely different conclusions
rules are in
Similar Conditions rules are redundant
conflict
different rules;
Different
could be eventually different rules
Conditions
merged
M
cons(i , j ) = ∑{| Bi ( yk ) − B j ( yk ) | ⇒ | Ai ( xk ) − A j ( xk ) |}
i =1
Alternatively
M
cons(i , j ) = ∑{Poss( Ai ( xk ) , A j ( xk )) ⇒ Poss( Bi ( yk ) , B j ( yk ))}
i =1
1 M
cons(i ) = ∑ cons(i , j )
M j =1
• Example
– n variables
– each granulated using p fuzzy sets
– number of different rules = pn
• Scalability challenges
Accuracy
Stability
Knowledge
Interpretability Representation