Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W. Ra ś

21
Action Rules Discovery Action Rules Discovery Systems: DEAR1, DEAR2, Systems: DEAR1, DEAR2, ARED, ….. ARED, ….. by by Zbigniew Zbigniew W. W. Ra Ra ś ś

description

Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W. Ra ś. Y = {x 2 , x 4 } Z = {x 1 ,x 2 ,x 3 ,x 4 ,x 5 ,x 7 }. LERS. (a, a 1 ) (a, a 2 ) (b, b 1 ) (b,b 2 ) ……….. (d,d 1 ) (d,d 2 ). atomic terms. Decision System S. r = [[(a, a 2 )*(b, b 1 )] → (d, d 1 )] - PowerPoint PPT Presentation

Transcript of Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W. Ra ś

Page 1: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Action Rules Discovery Systems: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, …..DEAR1, DEAR2, ARED, …..

byby

Zbigniew Zbigniew W. W. RaRaśś

Page 2: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

LERS

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1) (a, a2)(b, b1)(b,b2)………..(d,d1)(d,d2)

Decision System Decision System SSatomic terms

r = [[(a, a2)*(b, b1)] → (d, d1)]

w Y → w Z

rule

Support:

Confidence:

)(

)()(

Ycard

ZYcardrconf

)()sup( ZYcardr

Y = {x2, x4}Z = {x1,x2,x3,x4,x5,x7}

sup(r) = 2conf(r) = 2/2 = 1

Page 3: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

a b c e f d

2 1 1 7 8 1

2 5 4 6 8 1

1 1 4 9 4 2

1 4 5 8 7 2

2 1 5 2 8 3

2 1 4 2 8 3

1 2 4 7 1 2

2 1 1 6 8 1

3 2 4 6 8 2

3 3 5 7 4 2

3 3 5 6 2 3

2 5 4 6 8 3

b c e f d

1 1 7 8 1

5 4 6 8 1

1 5 2 8 3

1 4 2 8 3

1 1 6 8 1

5 4 6 8 3

b c e f d

2 4 6 8 2

3 5 7 4 2

3 5 6 2 3

Splitting the node using the stable attributeDom(a) = {1,2,3} & Dom(b) = {1,2,3,4,5}

All objects have the same decision value, so this sub-table is not analyzed any further

None of the objects contain the desired class “1”, so this sub-table stops splitting any further

a = 1 a =

2

a = 3

b c e f d

1 9 4 4 2

4 5 8 7 2

2 4 7 1 2

c e d

1 7 1

5 2 3

4 2 3

1 6 1

c e d

4 6 1

4 6 3

b = 1 b = 5

All the flexible values are the same for both objects , therefore this sub-table is not analyzed any further

Partition decision table S Stable:{ a, b}

Flexible: {c, e, f}

Reclassification direction:

2 1 or 3 1

All objects have the same value 8 for attribute f, so it is crossed out from the sub-table ( this condition is used for stable attributes as well)

T1

T2

T3

T4

T5

Action Rules Discovery (Preprocessing)

Page 4: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Table: Set of rules R with supporting objects

Figure of (d, H)-tree T1

Figure of (d, L)-tree T2

Objects a b c dx1, x2, x3, x4 0 L

x1, x3 0 L

x2, x4 2 L

x2, x4 1 L

x5, x6 3 L

x7, x8 2 1 H

x7, x8 1 2 H

Objects a b cx1, x2, x3, x4 0

x1, x3 0

x2, x4 2

x2, x4 1

x5, x6 3

Objects b c

x1, x3 0

x2, x4 2

x2, x4 1

x5, x6 3

Objects b

x2, x4 2

x5, x6 3

c = 1c = ? c = 0

Objects b c

x1, x2, x3, x4

Objects b

x1, x3

a = 0

Objects b

x2, x4

a = ?

Objects a b cx7, x8 2 1

x7, x8 1 2

Objects b c

x7, x8 1

a = 2

Objects b c

x7, x8 1 2

a = ?

Stable Attribute: {a, c}

Flexible Attribute: b

Decision Attribute: d

T1 T2

T3T4

(T3, T1) : (a = 2) (b, 21) ( d, L H)

(a = 2) (b, 31) ( d, L H)

Objects b

x7, x8 1

c = ? c = 2Objects b

x7, x8 1

c = ?Objects b

x1, x2, x3, x4

T5

T6

System DEAR1 System DEAR1

Page 5: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Objects a b c d

r1 x1, x2, x3, x4 0 L

r2 x1, x3 0 L

r3 x2, x4 2 L

r4 x2, x4 1 L

r5 x5, x6 3 L

r6 x7, x8 2 1 H

r7 x7, x8 1 2 H

Objects a b c dx1, x2, x3, x4 0 L

x1, x3 0 L

x2, x4 2 L

x2, x4 1 L

x5, x6 3 L

x7, x8 2 1 H

x7, x8 1 2 H

Stable Attribute: b

Flexible Attribute: {a, c}

Decision Attribute: d

Objects a c dx1, x2, x3, x4 0 L

x1, x3 0 L

x2, x4 L

x2, x4 1 L

b = 2

Objects a c dx1, x2, x3, x4 0 L

x1, x3 0 L

x2, x4 1 L

x5, x6 L

b = 3

Objects a c dx1, x2, x3, x4 0 L

x1, x3 0 L

x2, x4 1 L

x7, x8 2 H

x7, x8 2 H

b = 1

Objects a cx1, x2, x3, x4 0

x1, x3 0

x2, x4 1

Objects a cx7, x8 2

x7, x8 2

d = L d = H

Set of rules R with supporting objects

(b = 1) (a, 02) ( d, L H)(b = 1) (c, 02) ( d, L H)(b = 1) (c, 12) ( d, L H)

System DEAR2

Page 6: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Cost of Action Rule

Action rule r:

[(b1, v1→ w1) (b2, v2→ w2) … ( bp, vp→ wp)](x) (d, k1→ k2)(x)

The cost of r in S:

costS(r) = {S(vi , wi) : 1 i p}

Action rule r is feasible in S, if costS(r) < S(k1 , k2).

For any feasible action rule r, the cost of the conditional

part of r is lower than the cost of its decision part.

Page 7: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Example:

r = [(b1, v1 → w1) … (bj, vj → wj) … ( bp, vp → wp)](x)

(d, k1 → k2)(x)

In RS[(bj, vj → wj)] we find

r1 = [(bj1, vj1 → wj1) (bj2, vj2 → wj2) … ( bjq, vjq → wjq)](x)

(bj, vj → wj)(x)

Then, we can compose r with r1 and the same replace

term (bj, vj → wj) by term from the left hand side of r1:

[(b1, v1 → w1) … [(bj1, vj1 → wj1) (bj2, vj2 → wj2) …

( bjq, vjq → wjq)] … ( bp, vp → wp)](x) (d, k1 → k2)(x)

Cost of Action Rule

Page 8: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1 → a1) (a, a2 → a2)(b, b1 → b1)(b, b2 → b2) ………..(d, d1 → d1)(d, d2 → d2)

Decision System Decision System SS atomic action terms

r=[(a, a2 → a2)*(b, b1 → b1)] → (d, d1 → d1)

(w, w) (Y, Y ) → (w,w) (Z, Z)

action rule

Support:

Confidence:

)(

)()(

Ycard

ZYcardrconf

)()sup( ZYcardr

Y = {x2, x4}Z = {x1,x2,x3,x4,x5,x7}

sup(r) = 2conf(r) = 2/2 = 1

Page 9: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1 → a1) (a, a2 → a2)(b, b1 → b1)(b, b2 → b2) ………..(d, d1 → d1)(d, d2 → d2)

Decision System Decision System SS atomic action terms

r=[(a, a2 → a1)*(b, b1 → b1)] → (d, d1 → d2)

(w1, w2) (Y1, Y 2) → (w1,w2) (Z1, Z2)

action rule

Support:

Confidence:

)(

)()(

Ycard

ZYcardrconf

)()sup( ZYcardr

Y = {x2, x4}Z = {x1,x2,x3,x4,x5,x7}

sup(r) = ?conf(r) = ?

Y=(Y1,Y2), Z=(Z1,Z2)w = (w1,w2)

Page 10: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1 → a1) (a, a1 → a2)(b, b1 → b2)(b, b2 → b2) ………..(d, d1 → d1)(d, d2 → d2)

Decision System Decision System SSatomic action

terms

r=[(a, a2 → a1)*(b, b1 → b1)] → (d, d1 → d2)

(Y1, Y 2) (Z1, Z2)

action rule

Support:

Confidence: ???)(

)()(

1

11

Ycard

ZYcardrconf

)()sup( 11 ZYcardr Y1 = {x2, x4}Z1 = {x1,x2,x3,x4,x5,x7}Y2 = {x1, x6}Z2 = { x6}

sup(r) = 2conf(r) = 2/2 = 1

Y1 → Z1, Y2 → Z2

Page 11: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1 → a1) (a, a1 → a2)(b, b1 → b2)(b, b2 → b2) ………..(d, d1 → d1)(d, d2 → d2)

Decision System Decision System SSatomic terms

r=[(a, a2 → a1)*(b, b1 → b1)] → (d, d1 → d2)

(Y1, Y 2) (Z1, Z2)

rule

)(

)(*

)(

)()(

2

2

1

1 21

Ycard

ZYcard

Ycard

ZYcardrconf

???)()sup( 11 ZYcardr Y1 = {x2, x4}Z1 = {x1,x2,x3,x4,x5,x7}Y2 = {x1, x6}Z2 = { x6}

sup(r) = 2conf(r) = 2/2 = 1

Page 12: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

(a, a1 → a1) (a, a1 → a2)(b, b1 → b2)(b, b2 → b2) ………..(d, d1 → d1)(d, d2 → d2)

Decision System Decision System SSatomic terms

r=[(a, a2 → a1)*(b, b1 → b1)] → (d, d1 → d2)

(Y1, Y 2) (Z1, Z2)

rule

)(

)(*

)(

)()(

2

2

1

1 21

Ycard

ZYcard

Ycard

ZYcardrconf

)}(),(min{)sup( 2211 ZYcardZYcardr Y1 = {x2, x4}Z1 = {x1,x2,x3,x4,x5,x7}Y2 = {x1, x6}Z2 = { x6}

sup(r) = 2conf(r) = 2/2 = 1

Page 13: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

Meaning of (d,d1 d2) in S:

NS(d,d1 d2)=[{x1,x2, x3, x4, x5, x7}, {x6}]

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

stable attribute

flexible attributes

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

Atomic classification terms:

(b,b1b1), (b,b2b2), (b,b3b3)(a,a1a2), (a,a1a1), (a,a2a2), (a,a2a1) (c,c1c2), (c,c2c1), (c,c1c1), (c,c2c2)

λ1 - minimum support, λ2 - minimum confidence

Page 14: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

stable attribute

flexible attributes

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

Notation: t1=(b,b1b1), t2=(b,b2b2), t3=(b,b3b3),

t4=(a,a1a2), t5=(a,a1a1), t6=(a,a2a2), t7=(a,a2a1),

t8=(c,c1c2), t9=(c,c2c1), t10=(c,c1c1),t11=(c,c2c2),

t12 = (d,d1 d2).

λ1 - minimum support, λ2 - minimum confidence

Page 15: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

For decision attribute in S:NS(d,d1 d2)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

For classification attribute in S:

NS(t1) = NS(b,b1b1) = [{x1,x2, x4, x6}, {x1,x2, x4, x6}] NS(t2) = NS(b,b2b2) = [{x3,x7, x8}, {x3,x7, x8}]

NS(t3) = NS(b,b3b3) = [{x5}, {x5}]

NS(t4) = NS (a,a1a2) = [{x1,x6, x7, x8}, {x2,x3, x4, x5}]

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

Not marked λ1=3

Mark “-” λ2=0

Mark “-” λ1=1

Mark “-” λ2=0

)()sup( 11 ZYcardr

Page 16: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

For decision attribute in S:NS(d,d1 d2)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

For classification attribute in S:

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

Not marked λ1=2

Mark “-” λ2= 0

Mark “+” λ1=4,λ2=1/4

NS(t5) = NS(a,a1a1) = [{x1,x6, x7, x8}, {x1,x6, x7, x8}] NS(t6)= NS(a,a2a2) = [{x2,x3, x4, x5}, {x2,x3, x4, x5}] NS(t7)= NS(a,a2a1) = [{x2,x3, x4, x5}, {x1,x6, x7, x8}]

Page 17: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

For decision attribute in S:

NS(t12)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2

λ1=2, λ2=1/4

For classification attribute in S:

NS(t1)=[{x1,x2, x4, x6}, {x1,x2, x4, x6}]

Not marked λ1=3

NS(t2)=[{x3,x7, x8}, {x3,x7, x8}] Marked “-” λ2=0

NS(t3)=[{x5}, {x5}] Marked “-” λ1=1

NS(t4)=[{x1,x6, x7, x8}, {x2,x3, x4, x5}]

Marked “-” λ2=0

NS(t5)=[{x1,x6, x7, x8}, {x1,x6, x7, x8}]

Not marked λ1=2

NS(t6)=[{x2,x3, x4, x5}, {x2,x3, x4, x5}]

Marked “-” λ2=0

Mark “+” λ1=4, λ2=1/4NS(t7)=[{x2,x3, x4, x5}, {x1,x6, x7, x8}]

r = [t7 t1]

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

Page 18: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

For decision attribute in S:

NS(t12)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2

λ1=2, λ2=1/4

For classification attribute in S:

NS(t8)= NS(c,c1c2) = [{x1,x4, x8}, {x2, x3, x5, x6, x7}]

Not marked

Marked “-”

NS(t10) = NS(c,c1c1) = [{x1, x4, x8}, {x1, x4, x8}] Marked “-”

NS(t11) = NS (c,c2c2)= [{x2, x3, x5, x6, x7}, {x2, x3, x5, x6, x7}]

Not marked

conf = 2/3 *1/5 <λ2

NS(t9) = NS(c,c2c1) = [{x2, x3, x5, x6, x7}, {x1, x4, x8}]

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

Page 19: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

For decision attribute in S:

NS(t12)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

For classification attribute in S:

Marked “+”

NS(t1*t11)=[{x2, x6}, {x2, x6}] Marked “-”, λ1=1

NS(t5*t8)=[{x1, x8}, {x6, x7}] Marked “-”, λ1=1

Rule r = [t1*t8→t12], conf = 1/2 ≥ λ2, sup=2 ≥ λ1

Now action terms of length 2 from unmarked action terms of length 1

NS(t1*t5)=[{x1, x6}, {x1, x6}] Marked “-”, λ1=1

NS(t1*t8)=[{x1, x4}, {x2, x6}]

NS(t5*t11)=[{x6, x7}, {x6, x7}] Marked “-”, λ1=1

NS(t8*t11)=[Ø, {x2, x3, x5, x6, x7}] Marked “-”

NS(t1)=[{x1,x2, x4, x6}, {x1,x2, x4, x6}] , NS(t5)=[{x1,x6, x7, x8}, {x1,x6, x7, x8}],

NS(t8)=[{x1,x4, x8}, {x2, x3, x5, x6, x7}], NS(t11)= [{x2, x3, x5, x6, x7}, {x2, x3, x5, x6, x7}].

Page 20: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

ARED Algorithm

For decision attribute in S:

NS(t12)=[{x1,x2, x3, x4, x5, x7}, {x6}]

Object reclassification from class d1 to d2 λ1=2, λ2=1/4

For classification attribute in S:

Action rules:

[[(b,b1→b1)*(c,c1→c2)] → (d, d1→d2)]

[[(a,a2→a1] → (d, d1→d2)]

XX a a bb cc dd

xx11 aa11 bb11 cc11 dd11

xx22 aa22 bb11 cc22 dd11

xx33 aa22 bb22 cc22 dd11

xx44 aa22 bb11 cc11 dd11

xx55 aa22 bb33 cc22 dd11

xx66 aa11 bb11 cc22 dd22

xx77 aa11 bb22 cc2 2 dd11

xx88 aa11 bb22 cc11 dd33

Page 21: Action Rules Discovery Systems: DEAR1, DEAR2, ARED, ….. by Zbigniew W.  Ra ś

Thank You

Questions?