Gi違i thu壱t BruteForce

Một phần của tài liệu Khai phá mẫu xu hướng tuần tự lên đối tượng từ tập dữ liệu chuỗi thời gian (Trang 55)

2. 305"Vt́pi"mj噂 p (Match)

4.3.1 Gi違i thu壱t BruteForce

""v逢荏pi"ej pj"e栄a gi違i thu壱t Brute-Hqteg"8吋 v·o"v医t c違 m磯u tu亥n t詠 ph鰻 bi院n

nk‒p"8嘘k"v逢嬰pi"vt‒p"f英 li羽u chu厩i th運i giap"8逢嬰e"z¤{"f詠ng d詠c"vt‒p"vkpj"vj亥n c栄a gi違i thu壱v"v·o"o磯u ph鰻 bi院n Apriori [1, 30]. Gi違i thu壱t Brute-Force th詠c hi羽p"swƒ"vt·pj" mjck"rjƒ"n員p t瑛ng m泳c t瑛 f逢噂k"n‒p"x "d逸v"8亥u t瑛 t壱p L1 (t壱r"eƒe"o磯w"e挨"d違p"e pi" ej pj"n "eƒe"oqvkhu"x噂i chi隠w"f k"mjƒe"pjcw"e„"8逢嬰c t瑛 swƒ"vt·pj"v·o"oqvkh"vt‒p"eƒe"

chu厩i th運k"ikcp"mjw{pj"j逢噂pi+0"N#"fq"vc"ej丑n t壱p L1 n "v壱r"eƒe"oqvkhu"n "x·"d違p"vj¤p" eƒe"oqvkhu"p {"8«"e„"u嘘 l亥n xu医t hi羽n l噂p"j挨p"jq員c b茨pi"pi逢叡ng h厩 tr嬰 t嘘i thi吋u do

pi逢運k"f́pi"8鵜pj"pij c0"Ucw"mjk" 8«"e„"v壱r"eƒe"rj亥n t穎 ph鰻 bi院n L1 vj·"ik違i thu壱t Brute-Force s胤 tri吋n khai s逸p x院p l衣k"eƒe"vj吋 hi羽n c栄a L1 theo th泳 t詠 th運k"ikcp"8亥u

x q"d茨pi"rj逢挨pi"rjƒr"SwkemUqtv0"雲d逢噂c k院 gi違i thu壱t ti院p"j pj"m院t h嬰r"eƒe"vj詠c th吋p {"8吋 t衣q"vj pj"v壱p 泳pi"xk‒p"E2x "mk吋m tra t壱p 泳pi"xk‒p"p {"8吋 ch丑p"eƒe"rj亥n t穎e„"uwrrqtv"vj臼a min-uwr"x "8逢c"x q"N2.Swƒ"vt·pj"p {"8逢嬰c th詠c hi羽n cho t噂i khi

mj»pi"vj吋 t衣q"8逢嬰c 泳pi"xk‒p"Ek cho Lk m噂i t瑛 Lk-1 (v噂i k 半 2). M員e"f́"#"v逢荏ng c栄a gi違i thu壱t Brute-Hqteg" v逢挨pi" 8嘘k" 8挨p" ik違n nj逢pi" swƒ" vt·pj" m院t h嬰r" eƒe" vj吋 hi羽n trong Lk-1 8吋 t衣q"vj pj"eƒe"泳pi"xk‒p"vtqpi"Nk d宇 f pi"f磯p"8院n kh違p<pi"d́pi"p鰻 t鰻

h嬰r"*8員c bi羽v"n "mjk"vc"zgo"zfiv"v噂i m嘘i quan h羽 d詠c"vt‒p"v pj"ej医t th運i kho違ng gi英a nh英ng th吋 hi羽p"p {+0"U嘘 n逢嬰ng t鰻 h嬰r"e„"vj吋 e„"p院w"swƒ l噂n s胤 d磯n t噂i swƒ"vt·pj"

ki吋m tra support count c栄a t瑛ng k院t h嬰p s胤 r医t t嘘p"mfio"x隠 m員t th運i gian (c泳 n ph亥n t穎 k院t h嬰r" 8逢嬰c t衣q" tc" vj·" rj違i ki吋m tra t嘘k" 8c" p2 l亥p" 8吋 l医{" 8逢嬰e" vj»pi" vkp" x隠

support count cho t瑛ng ph亥n t穎+0"A吋 v<pi"v嘘e"ejq"swƒ"vt·pj"v pj"uwrport count cho

eƒe"rj亥n t穎 k院t h嬰r"e pi"pj逢"mk吋o"vtc"8瓜 ph鰻 bi院n c栄a nh英pi"vj pj"rj亥n m磯u con (subpattern), lu壱p"x<p"u胤 s穎 d映ng m瓜t b違pi"d<o"f衣ng Dictionary trong C#. Ph亥n sau s胤vt·pj"d {"eƒe"d逢噂c c映 th吋 c栄a gi違i thu壱t.

D逢噂c 1<"Z¤{"f詠ng L2 t瑛 L1

Zfiv"4"th詠c th吋 o"x "p"e栄a L1 Hai th詠c th吋 p {"ej雨 e„"vj吋 8逢嬰c k院t h嬰p n院u

pj逢"vj運k"8k吋m b逸v"8亥u c栄a th詠c th吋 m nh臼j挨p"jq員c b茨ng th運k"8k吋m b逸v"8亥u c栄a th詠c th吋: m.StartPosition 判p0UvctvRqukvkqp0"Swƒ"vt·pj"m院t h嬰r"8吋 t衣o ra m瓜t 泳pi"xk‒p"E2 8逢嬰e"o»"v違pj逢"ucw<

‚N院u 2 th詠c th吋 o"x "p"8院n t瑛 épi"o瓜v"8嘘k"v逢嬰pi"*épi"o瓜t c鰻 phi院w+"vj·"

chu厩i s詠 ki羽n m ch雨 e„"vj吋 k院t h嬰p v噂i n khi chu厩i s詠 ki羽n n x違y ra sau khi chu厩i s詠

J·pj"4.6 Minh h丑a quan h羽 precedes

Mjk"8„"m院t h嬰p t衣q"8逢嬰c s胤e„"f衣ng: m-m.ID<p:delta>n-n.ID

V噂k"ÐrÑ"n "m "jk羽w"8衣i di羽p"ejq"rjfir"vqƒp"ÐrtgegfguÑ"vtqpi"9"rjfir"vqƒp"8衣i s嘘

quan h羽 Allen. Ch雨 s嘘fgnvc"*fgnvc"@"2+"8員e"vt逢pi"ejq"kho違pi"eƒej"x隠 th運i gian gi英a 2 chu厩i s詠 ki羽p"o"x "p0"M "jk羽w"o0KF"x "p0KF"8員e"vt逢pi"ejq"8鵜pj"fcpj"rj¤p"dk羽t c栄a t瑛pi"8嘘k"v逢嬰pi"*8吋 ta bi院v"o"x "p"8院n t瑛 8嘘k"v逢嬰pi"p q+0"Vtqpi"vt逢運ng h嬰r"vt‒p"vj·" o0KF"?"p0KF"*épi"8嘘k"v逢嬰ng).

X "f映<"vc"e„"4"vj詠c th吋 L1: EEB-CED"]2̲""*2"n "vj運k"8k吋m b逸v"8亥u c栄c"ơ"x "

ABB-CED"]9̲"*9"n "vj運k"8k吋m b逸v"8亥u c栄c"p+"vj·"ucw"mjk"m院t h嬰p ta s胤 e„"o瓜t th詠c th吋 thu瓜c C2 pj逢"ucw<""GGD"ÎACB<p:4>ABB ÎACB b逸v"8亥u t衣i th運k"8k吋m 0.

‚N院u 2 th詠c th吋 o"x "p"8院n t瑛 2 chu厩i d英 li羽u th運k"ikcp"mjƒe"nhau (ch鰯ng h衣n t瑛 2 lo衣i c鰻 phi院w" mjƒe" pjcw<" o0ID 塙 n.KF+" vj·" piq k" o嘘i quan h羽 8k" vt逢噂c

*rtgegfgư"pj逢"8«"ik噂i thi羽w"vj·"vc"e„"vj‒o"8"f衣ng quan h羽 e„"vj吋 e„"ik英c"o"x "p" vjgq"8衣i s嘘 quan h羽 Allen: meets, overlaps, Finished by, contains, starts."x "equal.

J·pj"4.8 Minh h丑a quan h羽ÐcontainsÑ

J·pj"4.9 Minh h丑a quan h羽ÐqxgtncruÑ

J·pj"4.11 Minh h丑a quan h羽ÐHkpkujgf"d{Ñ

J·pj"4.12 Minh h丑a quan h羽ÐgswcnÑ

Gi違i thu壱t s胤 ti院p"j pj"mk吋m tra t瑛ng m嘘i quan h羽e„"vj吋 e„"mjk"v衣o k院t h嬰p t瑛 eƒe"vj詠c th吋. K院t h嬰p t衣q"vj pj"u胤 e„"vj‒o"8"f衣ng sau (ngo衣i tr瑛 rtgegfgu"8«"8隠

c壱p)

- meets (m): m-m.ID<m:0>n-n.ID - overlaps (o): m-m.ID<o:d>n-n.ID - Finished by (F): m-m.ID<F:d>n-n.ID - contains (D): m-m.ID<D:d>n-n.ID - starts (s): m-m.ID<s:d>n-n.ID - equal (e): m-m.ID<e:d>n-n.ID

Ucw"mjk"8«"e„"8逢嬰c th詠c th吋 thu瓜c t壱p 泳pi"xk‒p"E2, gi違i thu壱t s胤 ti院p"j pj"

ki吋m tra xem support c栄a 泳pi"xk‒p"p {"e„"vj臼c"o«p"okp-uwr"fq"pi逢運k"f́pi"8逢c"tc" jc{"mj»pi0"P院u th臼c"o«p"vj·"8逢c"泳pi"xk‒p"vtqpi"C2 x q"N2.

D逢噂e"4<"Z¤{"f詠ng t壱p L3 t瑛 t壱p L2

Gi違 s穎vc"e„"4"vj詠c th吋 thu瓜c t壱p L2 n "o"x "p."eƒe"vj詠c th吋p {"e„"8鵜nh d衣ng

pj逢"ucw<

Th詠c th吋 m: m1-m1.ID<operator type1 : delta time1>n1-n1. ID Th詠c th吋 n: m2-m2.ID<operator type2 : delta time2>n2-n2.ID

Hai th詠c th吋o"x "p ch雨 e„"vj吋8逢嬰c k院t h嬰r"mjk""ej¿pi"z違{"tc"épi"vj運k"8k吋m

x "rj亥p"8亥u c栄a 2 th詠c th吋 p {"vt́pi"mj噂r"pjcw."pij c"n <"m1-m1. ID 岩 m2-m2. ID, 2 ph亥n t穎 8w»k"e„"vj吋 k院t h嬰r"8逢嬰c v噂i nhau (n1-n1. ID 橋 n2-n2. ID). Th詠c th吋 k院t h嬰p m噂i s胤e„"8鵜nh d衣ng:

m1-m1.ID<operator type1 : delta time1>n1-n1.ID< operator type3 : delta time3>n2-n2.ID

雲 8¤{"vj»pi"vkp"x隠 operator type3 x "fgnvc"vkog3 e„"8逢嬰c t瑛 vi羽c k院t h嬰p 2 ph亥n t穎8w»k0"Swƒ"vt·pj"m院t h嬰p 2 ph亥n t穎8w»k"8逢嬰c th詠c hi羽n gi嘘pi"pj逢"m院t h嬰p 2 th詠c th吋 thu瓜c L1 *vj»pi"swc"9"rjfir"vqƒp"8衣i s嘘 quan h羽 th運i gian Allen). Operator type3 ej pj"n "o瓜v"vtqpi"9"rjfir"vqƒp"8衣i s嘘 quan h羽 th運i gian Allen th吋 hi羽n m嘘i quan h羽 v隠 th運i gian gi英a 2 ph亥n t穎 8w»k0" Fgnvc" vkog3 cho ta bi院v" vj»pi" vkp" vj運i kho違pi"ej pj"zƒe"e栄a m嘘i quan h羽p {0"Ucw"8„"vc"vk院p"j pj"mk吋o"vtc"zgo"8嘘k"v逢嬰ng C3 v瑛a t衣q"e„"uwrrqtv"vj臼a min-sup jc{"mj»pi"x "8逢c"x q"v壱p L3 n院u th臼ạ

D逢噂e"5<"Z¤{"f詠ng Lk t瑛 Lk-1

M瓜v"eƒej"v鰻pi"swƒv."vc"jq p"vq p"e„"vj吋 t衣o m瓜t 泳pi"xk‒p"荏 m泳c k t瑛 2 th詠c th吋 trong Lk-1.G丑k"o"x "p"n "jck"vj詠c th吋 trong Lk-1 , 2 th詠c th吋p {"u胤e„"f衣ng:

- m = m1-m1.ID <operator type1 : delta time1> m2-m2.ID <operator type2 : delta time2>È0>"qrgtcvqt"v{rgk-2 : delta timek-2> mk-1-mk-1.ID

- n = n1-n1.ID <qrgtcvqt" v{rgÓ1 <" fgnvc" vkogÓ1> n2-n2.ID <qrgtcvqt" v{rgÓ2 :

V噂i m1."È."ok-1, n1."È."pk-1 n "eƒe"vj詠c th吋 trong L10"Eƒe"m "jk羽u operator type1." È." qrgtcvqt" v{rgk-2." qrgtcvqt" v{rgÓ1." È." qrgtcvqt" v{rgÓk-2 n " o瓜t trong b違y

rjfir"vqƒp"swcp"j羽 8衣i s嘘 th運k"ikcp"Cnngp"*r."ọ"q."H."F."ụ"g+0"E”p"fgnvc"vkog1."È."

delta timek-2." fgnvc" vkogÓ1." È." fgnvc" vkogÓk-2 n " pj英pi" vj»pi" vkp" ej pj" zƒe" x隠 th運i kho違ng 泳ng v噂k"eƒe"o嘘i quan h羽 gi英c"eƒe"vj pj"rj亥n trong hai th詠c th吋荏 m泳c k Î

1.

K院t h嬰p gi英c"o"x "p"ej雨e„"vj吋8逢嬰c ch医p nh壱p"mjk"x "ej雨mjk"o"x "p"e„"épi"

th運k"8k吋m b逸v"8亥w"x "e„"v医t c違eƒe"vj pj"rj亥n t衣q"vj pj"ik嘘ng nhau (tr瑛vj pj"rj亥n cu嘘k"épi"ok-1-mk-1.ID != nk-1-nk-1.ID. K院t qu違 c栄c"rjfir"m院t h嬰p s胤 ra 泳pi"xk‒p"Ek e„"f衣ng:

m1-m1.ID<operator type1 : delta time1> m2-m2.ID<operator type2 : delta time2>È0>"qrgtcvqt"v{rgk-2 : delta timek-2> mk-1-mk-1.ID <operator typek-1 : delta timek-1> nk-1-nk-1.ID

V逢挨pi"v詠 v噂k"eƒe"d逢噂e"vt‒p."ej雨 nh英ng k院t h嬰p Ck e„"uwrrqtv"eqwpv"n噂p"j挨p"

ho員c b茨ng min-sup vj·"o噂k"8逢嬰e"8逢c"x q"Nk.

X " f映<" Zfiv" 4" vj詠c th吋 thu瓜c L2: m = AA-NY<p:2>AAA-P[" x " p" ?" CC- NY<p:10>FF-NỴ M瓜t k院t h嬰p h嬰p l羽 C3 c„" vj吋 e„" n <" CC-NY<p:2>AAA- NY<p:5>FF-NỴ

O«"ik違 c栄a gi違i thu壱v"Dtwvg"Hqteg"8逢嬰e"8隠 xu医v"e„"p瓜k"fwpi"pj逢"j·pj"60350" Vc"n逢w"#"t茨pi"t pi"dw瓜c theo Apriori s胤 8逢嬰c ki吋m tra t衣k"f”pi"vj泳 34"e pi"pj逢"

vi羽c ki吋o" vtc" v pj" j嬰p l羽 c栄a th詠c th吋 k院t h嬰r" 8逢嬰c th詠c hi羽n b荏k" j o"

CombineInstances t衣k"f”pi"320"Pic{"ucw"mjk"8逢嬰c ch泳pi"okpj"n "o瓜t k院t h嬰p h嬰p l羽, ta s胤 n逢w"vj詠c th吋 k院t h嬰r"x q"o瓜t b違pi"d<o0"Ucw"8„"泳ng v噂i m厩i l亥n m瓜t th詠c th吋 k院t h嬰p m噂k"8逢嬰c t衣q"tc"8«"zw医t hi羽p"vt逢噂e"8„"vtqpi"d違pi"d<ọ"vc"v<pi"ej雨 s嘘 8院m trong b違pi"d<o"n‒p"30"Vj»pi"swc"xk羽c s穎 d映ng b違pi"d<ọ"ik違i thu壱v"ik¿r"vk院t ki羽m th運k"ikcp"v·o"mk院m cho nh英ng th詠c th吋 k院t h嬰r"8«"zw医t hi羽p"vt逢噂e"8„"x·"vj運i

ikcp"v·o"mk院o"vt‒p"d違pi"d<o"n "Q*3+"8嘘i v噂k"vt逢運ng h嬰r"vtwpi"d·pj0"Vj»pi"swc"xk羽c

n逢w"vt英 m瓜v"ikƒ"vt鵜 bi院p"8院o"d‒p"e衣nh t瑛ng ph亥n t穎 trong b違pi"d<ọ"vc"e pi"f宇f pi"

ki吋m tra xem ph亥n t穎 p q"n "o瓜t m磯u th詠c s詠 *pij c"n "e„"uwrrqtv"eqwpv"半 min- sup+0"Piq k"tc."v医t c違eƒe"o磯u ph鰻 bi院n 荏 m泳c k Î 3"e pi"8逢嬰e"n逢w"vtqpi"o瓜t b違ng

d<o"mjƒe"8吋 h厩 tr嬰 ejq"swƒ"vt·pj"z¤{"f詠ng t壱p m磯u ph鰻 bi院n 荏 m泳c k (c映 th吋 n "

ki吋o"vtc"8瓜 ph鰻 bi院n c栄c"eƒe"uwdrcvvgtp+0

F́"d違n ch医v"n "o瓜t gi違i thu壱v"vjgq"j逢噂pi"xfiv"e衣p"pj逢pi"8隠 v k"x磯p"e„"pj英ng c違i ti院n nh医v"8鵜nh cho Brute-Hqteg"vj»pi"swc"xk羽c s穎 d映ng b違pi"d<o"8吋 v<pi"v嘘e"x "

h厩 tr嬰 cho qwƒ"vt·pj"mjck"rjƒ"8逢嬰c t嘘v"j挨p0

Input:

-listPattern: an input list of primitive patterns

-min_sup: a minimum support count which is a user-specified threshold -TSLen: length of each time series

-Dictionary<string, byte> SubDictionary: a hash table used to check if a subsequence is frequent

Output: List<Pattern> returnList: an output list of all frequent patterns

Algorithm:

1. if (listPattern.count == 0) return; 2. //Obtain all instances from listPattern 3. listInstances = listPattern.GetInstances();

4. //Sort these instances by their starting points in time 5. QuickSort(listInstances)

6. //Create a hash table to help calculating the support count of each pattern

7. dictionary = [];

8. for i = 0 to listInstances.Count - 1

9. for j = i + 1 to listInstances.Count - 1

10. instance = CombineInstances (listInstances[i], listInstances[j] );

11. if(instance is not null)

12. if(instancẹk <= 1 || CheckSubSequence(instance, SubDictionary)

13. if (!dictionarỵcontains(instances))

14. //Create a pattern corresponding to the instance which has been combined

15. Pattern p = new Pattern(instance);

16. dictionarỵađ(p);

17. else

18. //Find an existing pattern in the hash table to ađ the instance which has been combined into the list of instances of the pattern

20. p.listInstances.Ađ(instance);

21. //Create a list of patterns who support counts satisfy min_sup 22. List<Pattern> L = [];

23. //Initialize SubDictionary to help checking if a subsequence is frequent in the next invocation

24. SubDictionary = [];

25. foreach (var item in dictionary)

26. if(CheckFrequentPattern(item, min_sup, TSLen)) 27. L.ađ(item);

28. returnList.ađ(item); 29. if(L.k >= 2)

30. SubDictionarỵađ(item)

31. RunBruteForce(L, minsup, TSLen, SubDictionary, returnList);

J·pj"4.13 O«"ik違 gi違i thu壱t Brute Force 4.3.2 Gi違i thu壱t d詠c"vt‒p"e医w"vt¿e"e¤{

Gi違i thu壱t Brute-Hqteg" 8逢嬰e" 8隠 c壱p 荏 vt‒p" 8«" e„" pj英ng c違i ti院n nh医v" 8鵜nh nh茨m h厩 tr嬰 v<pi"v嘘e"ejq"swƒ"vt·pj"mjck"rjƒ"o磯w0"Vw{"pjk‒p"ik違i thu壱t v磯n ph違i ti院n

j pj"mk吋o"vtc"x "mj荏i t衣o m瓜t s嘘n逢嬰ng k院t h嬰p r医t l噂p0"Vt逢噂c v医p"8隠 p {."nw壱p"x<p" 8«"8隠 xu医v"vj‒o"o瓜t gi違i thu壱v"mjck"rjƒ"vj泳 hai e pi d詠c"vt‒p"eƒej"vk院p c壱n l員p t瑛ng m泳c t瑛f逢噂k"n‒p0"Ik違i thu壱v"p {"u胤e„"mj違p<pi"pj壱n bi院v"8逢嬰c ph亥n l噂p"eƒe"m院t h嬰p h嬰p l羽 ngay t瑛 8亥w"x "nq衣i b臼 nh英pi"rjfir"m院t h嬰r"o "vc"dk院t ch逸e"n "u胤 mj»pi"vj吋

t衣q"tc"8逢嬰c k院t h嬰p h嬰p l羽. Gi違i thu壱v"mj»pi"ej雨 d詠c"vt‒p"d違pi"d<o"o "e”p"z¤{"

d詠ng d詠c"vt‒p"o瓜t c医w"vt¿e"f英 li羽u d衣pi"e¤{"rj́"j嬰r"ejq"swƒ"vt·pj"mjck"rjƒ"o磯u xu

j逢噂ng tu亥n t詠 nk‒p"8嘘k"v逢嬰ng d詠c"vt‒p"vkpj"vj亥n c栄a gi違i thu壱t FP-Itqyvj"8«"v瑛ng

8逢嬰e"8隠 c壱p 荏 [1, 37]

Lu壱p"x<p"i丑i gi違i thu壱v"p { n "ik違i thu壱t d詠c"vt‒p"e医w"vt¿e"e¤{"*vtgg"dcugf" cniqtkvjơ" x " e¤{" 8逢嬰c s穎 d映pi" 8逢嬰c g丑k" n " VR-tree (Temporal Pattern Tree). Nh英ng ph亥n n瓜k"fwpi"8逢嬰e"vt·pj"d {"rj c"ucw"u胤 8逢c"tc"eƒe"8鵜pj"pij c"e映 th吋 cho

e¤{"e pi"pj逢"eƒe"j o"x "vj栄 t映e"ik¿r"vc"vjcq"vƒe"vt‒p"e医w"vt¿e"e¤{"p {0

E¤{"i欝o"p"p¿v."o厩k"p¿v"8衣i di羽n cho m瓜v"vj pj"rj亥n c栄a m磯u tu亥n t詠 ph鰻

bi院p"nk‒p"8嘘k"v逢嬰pi0"A嘘i v噂k"eƒe"o磯u tu亥n t詠 ph鰻 bi院n 荏 m泳c 1 (泳ng v噂i L1+"vj·"o厩i

p¿v"ej pj"n "o瓜v"oqvkh"e„"8逢嬰c t瑛ikck"8q衣p"v·o"mk院o"oqvkhu0"Swƒ"vt·pj"k院t h嬰r"eƒe" p¿v"荏 m泳c k Î 3"8吋 t衣q"vj pj"eƒe"p¿v"荏 m泳e"m"e pi"v逢挨pi"v詠 v噂k"swƒ"vt·pj"v衣o t壱p

泳pi"xk‒p"Ek t瑛 t壱p m磯u tu亥n t詠 ph鰻 bi院n Lk-1. Nh英pi"p¿v"p q"8逢嬰c t衣q"vj pj"e„"8瓜

h厩 tr嬰 l噂p"j挨p"jq員c b茨ng min-sup s胤8逢嬰e"8逢c"x q"e¤{0"Xk羽e"vt ej"zw医v"tc"eƒe"o磯u tu亥n t詠 ph鰻 bi院p"e„"8逢嬰c b茨pi"eƒej"fw{羽v"8羽swk"vt‒p"e¤{"x瑛a t衣ọ

J·pj"4.14 Minh h丑a m瓜t node trong c医w"vt¿e"e¤{

M瓜v"p¿v"vtqpi"e¤{"dcq"i欝o"eƒe"vj pj"rj亥n:

oParentNode ch泳a tham kh違o t噂i node cha c栄a node hi羽n t衣i

oOperatorType ch泳c"vj»pi"rjfir"vqƒp"8衣i s嘘 quan h羽 th運i gian Allen (g欝m 7

8鵜nh d衣pi">r@.">o@.">g@.">u@.">H@.">F@.">q@+"x "ejq"dk院t d衣ng quan h羽 gi英c"p¿v" 8cpi"zfiv"x噂k"p¿v"ejc"e栄c"p„

oDeltaTime: ch泳c"vj»pi"vkp"vj運i kho違ng c映 th吋ejq"rjfir"vqƒp"8衣i s嘘 quan h羽

th運i gian v瑛c"p‒w0

oPatternLength: chi隠w"f k"o磯w"v pj"v噂k"p¿v"jk羽n t衣ị

oInfo: n瓜i dung c栄a m磯w"o "p¿v"p {"vj吋 hi羽n

oKF<"8鵜nh danh c栄c"8嘘k"v逢嬰ng (c鰻 phi院w+"o "p¿v"p {"dk吋u di宇n

ok: m泳c c栄c"p¿v"*ej鰯ng h衣n 泳ng v噂k"p¿v"泳ng v噂i L2 vj·"m"?"4+

oList of Instances: t医t c違 eƒe"vj詠c th吋 泳ng 荏 t瑛ng v鵜 vt "zw医t hi羽n c栄a m磯u

泳ng v噂k"p¿v"8cpi"zfiv0

oList of ChildNodes: b違pi"d<o"ej泳a tham kh違o t噂k"eƒe"p¿v"eqp"e栄c"p¿v"jk羽n t衣k"x "eƒe"p¿v"eqp"p {"荏 t亥ng th泳 m"-"30"Vj»pi"vkp"ejq"mj„c"e栄a m瓜t ph亥n t穎 8逢嬰c

z¤{"f詠ng trong b違ng b<o"dcq"i欝m: [OperatorType t噂k"p¿v"eqp"-"DeltaTime + Info c栄c"p¿v"eqp"-"ID c栄c"8嘘k"v逢嬰ng o "p¿v"eqp"rj映 thu瓜c].

b.Z¤{"f詠ng TP-tree

永ng v噂i c医w"vt¿e"pqfg"8«"8逢嬰e"8鵜pj"pij c"pj逢"vt‒p."vc"u胤 z¤{"f詠ng TP-tree

vjgq"rj逢挨pi"rjƒr"l員p t瑛ng m泳c t瑛 m泳c 0 t噂i m泳c k. Eƒej"vj泳e"z¤{"f詠pi"p {"v逢挨pi"

t詠 v噂k"swƒ"vt·pj"v·o"eƒe"o磯u tu亥n t詠 ph鰻 bi院n 荏 m泳c k Î 1 r欝k"ucw"8„"f́pi"m院t qu違 p {"8吋v·o"v壱p m磯u tu亥n t詠 ph鰻 bi院n 荏 m泳c k. Ta nh壱n th医y m瓜t qui t逸c 荏 8¤{"n "o瓜t m磯u 荏 m泳c k ch雨 e„"vj吋 8逢嬰c t衣o t瑛 t医t c違 nh英pi"p¿v"荏 m泳c k-1 e„"épi"p¿v"ejc0" V pj"ej医v"p {"ik¿r"ejq"ik違i thu壱v"vtƒpj"8逢嬰c vi羽c ki吋m tra t衣o nh英ng t鰻 h嬰r"mj»pi"

c亥n thi院v"x "fq"8„"v<pi"v嘘e"8逢嬰e"swƒ"vt·pj"mjck"rjƒ.

Chi ti院t t瑛pi"d逢噂c c栄a thu壱t gi違k"8逢嬰e"o»"v違pj逢"ucw<

D逢噂c 1 - Kh荏i t衣o TP-tree:

T衣q"p¿v"i嘘c root mang ikƒ"vt鵜 pwnn0"Vc"iƒp"pj«p"ejq"p¿v"tqqv"p {"n "2"x·"p¿v" p {"v逢挨pi"泳ng v噂i m泳c 0 c栄a m磯ụ

D逢噂c 2 Î X穎n#"N1:

T瑛 t壱p L1 Îej pj"n "o"oqvkhu"e„"8逢嬰c t瑛 eƒe"ejw厩i th運k"ikcp"mjw{pj"j逢噂ng

mjƒe"pjcw"x噂i support count l噂p"j挨p"jq員c b茨ng min-sup, ta t衣q"o"pqfgu"x "8逢c"x q" vtqpi"e¤{"泳ng v噂i m泳c 1. Kho違pi"eƒej"v瑛 eƒe"pqfg"荏 m泳e"3"p {"v噂k"p¿v"i嘘c b茨ng 0

x "Cnngp"QrgtcvqtV{rg"e栄a t瑛pi"pqfg"j逢噂ng t噂k"pqfg"tqqv"8隠w"8逢嬰e"ugv"ikƒ"vt鵜 r厩ng.

J·pj"違nh c栄c"e¤{"ucw"4"d逢噂e"3"x "4"8逢嬰c th吋 hi羽p"pj逢"j·pj 4.15 d‒p"f逢噂i (gi違 s穎 L1

e„"5 m磯u)

J·pj"4.15 O»"v違 c医w"vt¿e"e¤{"ucw"d逢噂e"3"x "4 D逢噂c 3 - Z¤{"f詠ng L2 t瑛 L1

Ta t衣o ra t医t c違 nh英ng k院t h嬰r"e„"vj吋 e„"ik英c"eƒe"p¿v"荏 m泳e"3"x·"v医t c違 eƒe" p¿v"荏 m泳e"3"8隠w"e„"ejwpi"p¿v"ejc"*ej pj"n "p¿v"g嘘e+0"D逢噂e"p {"e pi"v逢挨pi"v詠 pj逢" d逢噂c 1 trong gi違i thu壱t Brute-Force v噂k" 9" rjfir" vqƒp" 8衣i s嘘 th運i gian Allen. Tuy

pjk‒p"vtqpi"vt逢運ng h嬰p s穎 d映ng c医w"vt¿e"e¤{."o瓜t k院t h嬰r"e„"8逢嬰c trong gi違i thu壱t d詠c"vt‒p"e医w"vt¿e"e¤{"u胤nk‒p"swcp"v噂i m瓜v"p¿v"vtqpi"VR-tree, nh運 8„"ik¿r"vc"f宇f pi"

ki吋m tra xem k院t h嬰r"8„"e„"rj鰻 bi院p"jc{"mj»pi0"永ng v噂i m厩i k院t h嬰p h嬰p l羽, ta s胤

t衣o m瓜v"p¿v"v逢挨pi"泳pi"8吋 n逢w"vj»pi"vkp"x隠 k院t h嬰r"8„0"Eƒe"p¿v"p {"8逢嬰e"8員t trong m瓜t b違pi"d<o"x噂k"m ej"vj逢噂c nh臼 j挨p"j鰯n so v噂i b違pi"d<o"8逢嬰e"f́pi"vtqpg gi違i thu壱t Brute-Force (do m厩i b違pi"d<o"p {"ej雨 8逢嬰c t衣q"ejq"swƒ"vt·pj"m院t h嬰p t瑛ng c員r"p¿v"vtqpi"N1 o "vj»k+0"P院w"pj逢"o瓜t k院t h嬰p m噂i t衣q"v逢挨pi"泳ng v噂i m瓜v"p¿v"8«"

xu医t hi羽p"vj· vc"mj»pi"e亥n ph違i t衣o ra m瓜t k院t h嬰p th壱t s詠o "ej雨 c亥n c壱p nh壱t v鵜 vt "

xu医t hi羽n c栄a th詠c th吋 k院t h嬰r"8„"vtqpi"vt逢運ng List of Instances c栄c"p¿v"v逢挨pi"泳ng. Sau khi t医t c違 k院t h嬰r"8«"8逢嬰e"8逢c"x q"eƒe"pqfg."vc"u胤 duy羽t qua b違pi"d<o"ej泳c"eƒe" pqfg"p {"8吋 zgo"8瓜 h厩 tr嬰 c栄c"eƒe"o磯u 泳ng v噂i t瑛pi"pqfg"e„"vj臼c"o«p"min-sup

jc{"mj»pi0"A嘘i v噂i m厩k"vt逢運ng h嬰p th臼c"o«p"okp-uwr."vc"8逢c"pqfg"v逢挨pi"泳pi"x q" e¤{"d茨pi"eƒej"v衣q"nk‒p"m院t gi英c"pqfg"8„"v噂k"p¿v"ejc"荏 m泳c L1.

J·pj"f衣ng c栄a TP-vtgg"ucw"d逢噂e"5"8逢嬰c th吋 hi羽p"swc"j·pj"6038"vtqpi"8„"eƒe" pqfg"}6.7.8.9.:ʼ"n "pj英ng node m噂k"8逢嬰e"8逢c"x q"e¤{"v衣i m泳c 2. M厩k"p¿v"泳ng v噂i m瓜t m磯u ph鰻 bi院p"x "pj逢"x壱{"vc"e„"7"o磯u ph鰻 bi院n 荏 m泳c 2.

J·pj"4.16 Minh h丑a c医w"vt¿e"e¤{"ucw"d逢噂c 3

Ta l医{"vj»pi"vkp"x隠 eƒe"o磯u ph鰻 bi院n 荏 m泳c 2 b茨pi"eƒej"fw{羽v"pi逢嬰c t瑛eƒe" p¿v"荏 m泳e"4"n‒p"v噂k"p¿v"o泳e"30"X "f映: duy羽t t瑛p¿v"6"n‒p"p¿v"3"vc"u胤 e„"o瓜t m磯u ph鰻

泳ng v噂k"eƒe"p¿v"3"x "6.""qrgtcvqt"v{rg"x "fgnvc"n "vj»pi"vkp"x隠 m嘘i quan h羽8逢嬰e"z¤{"

d詠ng d詠a tr‒p"rjfir"vqƒp"8衣i s嘘 th運k"ikcp"Cnngp"x "8逢嬰e"n逢w"vtqpi"pqfg"60"A瓜 h厩 tr嬰

c栄a m磯w"vt‒p"v逢挨pi"泳ng v噂i s嘘 th詠c th吋 n茨o"vtqpi"fcpj"uƒej"vj詠c th吋荏 node 4.

D逢噂c 4 ÎZ¤{"f詠ng L3 t瑛 L2

Vtqpi"vt逢運ng h嬰p n院u ta s穎 d映ng gi違i thu壱t Brute-Force, ta ph違i ki吋m tra kh違 p<pi"m院t h嬰p t衣o ra ph亥n t穎泳pi"xk‒p"E3 t瑛 t医t c違eƒe"vj詠c th吋 trong t壱p L20"A嘘i v噂i gi違i thu壱t d詠c"vt‒p"e医w"vt¿e"e¤{."vc"fw{羽t qua TP-tree t噂i t亥ng th泳 2 (泳ng v噂i L2+"x "

ch雨 ti院p"j pj"mj荏i t衣o k院t h嬰p gi英c"eƒe"pqfg"e„"ejwpi"pqfg"ejc"o "vj»k0"Pij c"n "vc"

ch雨 c亥p"zgo"zfiv"eƒe"pqfg"e„"ejwpi"rtghkz"rcvj"ejq"v噂i m泳c n茨m vt逢噂c 1 m泳c c栄a

eƒe"pqfg"8cpi"zfiv0"Vc"zfiv"e¤{"e„"8逢嬰e"ucw"d逢噂c 3 荏 j·pj"60380"P院w"pj逢"u穎 d映ng gi違i thu壱t Brute-Force, ta ph違i ki吋m tra kh違 p<pi"v衣o k院t h嬰p t瑛 t医t c違 nh英ng m磯u

泳ng v噂i t壱p L2 o "e映 th吋n "}2."3."6ʼ."}2."3."7ʼ."}2."3."8ʼ."}2."5."9ʼ."x "}2."5.":ʼ0"A嘘i v噂i gi違i thu壱t d詠c"vt‒p"e医w"vt¿e"e¤{."vc"ej雨 c亥n ki吋m tra kh違p<pi"v衣o k院t h嬰p c栄c"eƒe"

m磯u trong L2 e„"ejwpi"rtghkz"rcvj<"}}2."3."6ʼ."}2."3."7ʼ."}2."3."8ʼʼ"x "}}2."5."9ʼ."}2."

3, 8}}. 雲 8¤{"t "t pi"jq p"vq p"mj»pi"vj吋 t衣q"8逢嬰c k院t h嬰p t瑛 nh英ng m磯u 泳ng v噂i

Một phần của tài liệu Khai phá mẫu xu hướng tuần tự lên đối tượng từ tập dữ liệu chuỗi thời gian (Trang 55)

Tải bản đầy đủ (PDF)

(101 trang)