Docsity

Mining Episodes-Distributed Queries-Lecture Notes, Study notes of Distributed Database Management Systems

Toggle sidebar
bg1
10 Mining Episodes
In the episode model, the data is a history of
events
; eachevent has a
type
and a time of occurrence. An
example of eventtype might be: \switch 34 became overloaded and had to drop a packet." It is probably
too general to haveanevent time of the form \some switch became overloaded." Several events may occur
at the same time, and there is no guarantee that some event happens at every time unit.
10.1 Applications of Epsiode Mining
๎˜
Mining \epsiodes," that is, sequences or sets of eventtyp es that occur within a short window, has been
used to help predict outages in the Finnish power grid; the paper of MTV is an abstraction of this
work.
๎˜
The same ideas could be used to monitor packet-switching or other communicationnetworks, to develop
rules for rerouting data in advance of congestion. It may also be possible to mine for rules that predict
failures from combinations of manifestations in a variety of complex systems.
10.2 Epsiodes
๎˜
A
parallel episode
is a set of eventtypes, e.g.,
f
A; B; C
g
. In diagrams, these episodes are represented
byavertical box with
A
,
B
, and
C
within. The intent of a parallel episode is that each of the events
in the episode occurs (within a window of time), but the order is not important.
๎˜
A
serial episode
is a list of eventtypes, e.g., (
A; B; C
). In diagrams, these events are shown in a
horizontal box, in order. The intent is that within a window of time, these events occur in order. Note
that a single eventmay be thought of as both a parallel and a serial episode.
๎˜
A
composite episode
is built recursively from events by serial and parallel composition. That is, a
composite episo de is either:
{
An event,
{
The serial composition of two or more events, or
{
The parallel composition of two or more events.
Thus. every serial and parallel episode is also a composite episode, but there are episodes that are
composite, yet not serial or parallel.
Example 10.1:
Figure 29 shows a composite episode. It is the serial composition of three episodes. The
๎˜Œrst is the single event
A
. Then comes the parallel epsiode
f
B; C;D
g
. The third is a composite episode
consisting of the parallel composition of the serial episodes (
E; F
) and (
G; H
). Two examples of orders of
these 8 events that are consistent with this episode are
ABC DE GF H
and
ACDB GH EF
.
2
A
B
C
D
EF
GH
Figure 29: A composite episo de
42
docsity.com
pf3
pf4

Partial preview of the text

Download Mining Episodes-Distributed Queries-Lecture Notes and more Study notes Distributed Database Management Systems in PDF only on Docsity!

10 Mining Episo des

In the episo de mo del, the data is a history of events ; each event has a type and a time of o ccurrence. An example of event typ e might b e: \switch 34 b ecame overloaded and had to drop a packet." It is probably to o general to have an event time of the form \some switch b ecame overloaded." Several events may o ccur at the same time, and there is no guarantee that some event happ ens at every time unit.

10.1 Applications of Epsio de Mining

 Mining \epsio des," that is, sequences or sets of event typ es that o ccur within a short window, has b een used to help predict outages in the Finnish p ower grid; the pap er of MTV is an abstraction of this work.

 The same ideas could b e used to monitor packet-switching or other communication networks, to develop rules for rerouting data in advance of congestion. It may also b e p ossible to mine for rules that predict failures from combinations of manifestations in a variety of complex systems.

10.2 Epsio des

 A paral lel episode is a set of event typ es, e.g., fA; B ; C g. In diagrams, these episo des are represented by a vertical b ox with A, B , and C within. The intent of a parallel episo de is that each of the events in the episo de o ccurs (within a window of time), but the order is not imp ortant.

 A serial episode is a list of event typ es, e.g., (A; B ; C ). In diagrams, these events are shown in a horizontal b ox, in order. The intent is that within a window of time, these events o ccur in order. Note that a single event may b e thought of as b oth a parallel and a serial episo de.

 A composite episode is built recursively from events by serial and parallel comp osition. That is, a comp osite episo de is either:

{ An event, { The serial comp osition of two or more events, or { The parallel comp osition of two or more events.

Thus. every serial and parallel episo de is also a comp osite episo de, but there are episo des that are comp osite, yet not serial or parallel.

Example 10.1 : Figure 29 shows a comp osite episo de. It is the serial comp osition of three episo des. The rst is the single event A. Then comes the parallel epsio de fB ; C ; D g. The third is a comp osite episo de consisting of the parallel comp osition of the serial episo des (E ; F ) and (G; H ). Two examples of orders of these 8 events that are consistent with this episo de are AB C D E GF H and AC D B GH E F. 2

A

B

C

D

E F

G H

Figure 29: A comp osite episo de

10.3 Monotonicity of Episo des and the A-Priori Algorithm

Given a window length w (an amount of time during which an episo de may o ccur), an episo de is frequent if it o ccurs in at least s windows, where s is the supp ort threshold. Note that the same sequence of events may show up as an episo de in several consecutive windows; we count one unit for each such window. However, no window can b e credited with having the same episo de o ccur more than once, even if we can construct the episo de from several di erent sets of events in the same window. Like frequent itemsets, frequent episo des are monotone: if an episo de E is frequent, then so is any episo de formed by deleting some events from E. Thus, we can construct all frequent episo des \levelwise," using a trick that is very much like a-priori.

  1. Let Ci b e the candidate episo des of size (numb er of events) i and let Li b e the frequent episo des of size i.
  2. For a basis, C 1 is the set of all event typ es.
  3. Construct Ci+1 from Li by putting in Ci+1 exactly those episo des E of size i + 1 such that deleting any one event from E yields an event from L + i.

Example 10.2 : The epsio de of size 3 in Fig. 30(a) can b e frequent (i.e., in C 3 ) only if the three episo des of Fig. 30(b) are frequent (i.e., in L 2 ). 2

A B

C

A B A

C

B

C

(a) (b)

Figure 30: Episo de (a) is a candidate in C 3 only if all three episo des (b) are in L 2

10.4 Checking Parallel Episo des

The big problem is converting Ci into Li by going once through the data and counting the supp ort for each episo de in Ci. A dumb algorithm will lo ok at each window of length w in turn, and for each candidate episo de check whether it is there; if so, add 1 to the supp ort for the episo de. The goal of MTV is to p erform work that is only prop ortional to the sum over all events of the numb er of candidate episo des (including the sub episo des of comp osite episo des) that have that event. The following algorithm was develop ed in class; it seems less restrictive than the one given in the pap er, since it do es not assume the imp ossibility of an event typ e app earing several times in a window. We describ e how the data is scanned once, to compute Li from Ci , considering each window in turn, from the b eginning of the sequence. The data structure needed:

  1. For each event typ e A:

(a) A count A.count of the numb er of times A has b een seen in the present window. (b) A linked list A.contains of all the events E that contain A.

  1. For each candidate episo de E :

(a) A time E.startingTime that is the b eginning of a consecutive sequence of windows in which E has always b een present, up to the present window.

  1. The same time as previously, if we were already in qi and the next input is other than Ai.

 If the NFA for episo de E enters the accepting state qn , but was not previously in that state, then set E.startingTime to the time currently asso ciated with qn.

 If any time asso ciated with a state is less that the current time minus w (the window length), then delete that state from the set of states the NFA is in. If the accepting state is thus lost, add E.startingTime minus the current time to E.support.

Example 10.3 : Supp ose the event E is (A; B ; C ). The NFA for E is as in Fig. 32.

A B C

any other other any

Figure 32: NFA for the episo de (A; B ; C )

Let the data include the following o ccurrences of A, B , and C , along with other event typ es, not shown: (A; B ; A; B ; C ); all these events are within the current window. Then the states of the NFA after each of these events is as shown in Fig. 33. Solid lines show how each state is derived from the previous one by transitions of the NFA, and dashed lines indicate the asso ciated time for each state. 2

A B A B C

Figure 33: Maintaining the set of states and their asso ciated times

10.6 Counting Comp osite Events

To extend the ab ove ideas to comp osite episo des, we must keep a \machine" of some sort for each sub episo de. It is the job of each machine to rep ort to the machine(s) for the sup erepiso de(s) of which it is a part whether or not it is present, and if so what is the most recent time at which it can b e construed to have b egun.

 If the sub episo de is the parallel comp osition of events and/or other sub episo des, we use a data structure like that of Section 10.4, but we replace the count for an event by the most recent b eginning time for a comp osite episo de.

 For serial episo des, we maintain an automaton, but the inputs are o ccurrences of its sub episo des.

 The starting time and supp ort only need to b e maintained for episo des in Ci , not for sub episo des.