Event Forecasting with Pattern Markov Chains
Event Forecasting with Pattern Markov Chains
Elias Alevizos, Alexander Artikis, George Paliouras
Complex Event Recognition lab,
Institute of Informatics & Telecommunications
National Centre for Scientific Research “Demokritos”
http://cer.iit.demokritos.gr/
Event Forecasting with Pattern Markov Chains
Introduction
Motivation
start
0
50 $
1
100 $
2
200 $
3
500 $
···
Event Forecasting with Pattern Markov Chains
Introduction
Motivation
start
I
0
Is this a fraud?
50 $
1
100 $
2
200 $
3
500 $
···
Event Forecasting with Pattern Markov Chains
Introduction
Motivation
start
0
50 $
I
Is this a fraud?
I
How long will it last?
1
100 $
2
200 $
3
500 $
···
Event Forecasting with Pattern Markov Chains
Introduction
Motivation
start
0
50 $
1
I
Is this a fraud?
I
How long will it last?
I
With what probability?
100 $
2
200 $
3
500 $
···
Event Forecasting with Pattern Markov Chains
Introduction
Online Probabilistic Complex Event Forecasting
I
Patterns defined as regular expressions.
I
Consume streams of events and forecast when a pattern is
expected to be fully matched.
I
Revise forecasts to reflect changes in the state of the pattern.
I
Remember “arbitrarily” long sequences.
Event Forecasting with Pattern Markov Chains
Introduction
Assumptions
I
Selection strategy: (partition)-contiguity.
I
Stream generated by a m-order Markov process.
I
Stream stationary.
I
A forecast reports for how many transitions we will have to
wait until a full match.
Event Forecasting with Pattern Markov Chains
Theory
Regular Expression → Pattern Markov Chain
R = a · c · c.
Σ = {a, b, c}.
b, c
start
0
No memory.
a
b
a
b
1
a
c
a
b, c
2
c
3
Event Forecasting with Pattern Markov Chains
Theory
Regular Expression → Pattern Markov Chain
R = a · c · c.
Σ = {a, b, c}.
b, c
start
a
b
a
0
No memory.
1
b
a
c
2
c
3
a
b, c
P (b) + P (c)
0
P (a)
P (b)
P (b)
1
P (a)
1.0
P (c)
P (a)
2
P (c)
3
Event Forecasting with Pattern Markov Chains
Theory
Regular Expression → Pattern Markov Chain
P (b | b)
0b
P (b | c)
P (a | a)
P (a | b)
1a
P (c | a)
P (a | c)
P (b | a)
P (b | c)
P (a | c)
P (c | b)
0c
P (c | c)
1.0
2c
P (c | c)
3c
Event Forecasting with Pattern Markov Chains
Implementation
Waiting-Time and Forecasts
I
Warm-up period to learn distributions.
I
Set a threshold, e.g., Pfcast = 50%.
a
a
a
start
0
b
a
1
b
2
a
b
b
3
b
4
Completion Probability
1
state:0
interval:5,12
state:1
state:2
state:3
0.8
0.6
0.4
0.2
0
1
2
3
4
5
6
7
8
Number of future events
9
10
11
12
Event Forecasting with Pattern Markov Chains
Implementation
Example: R = a · b · b · b.
a
a
a
start
0
a
1
b
2
b
3
b
4
a
b
b
Completion Probability
1
state:1
interval:3,8
0.8
0.6
0.4
0.2
0
1
2
3
4
5
6
7
8
9 10 11 12
Number of future events
Event Forecasting with Pattern Markov Chains
Implementation
Example: R = a · b · b · b.
a
a
a
start
0
a
1
b
2
b
3
b
4
a
b
b
Completion Probability
1
state:2
interval:2,4
0.8
0.6
0.4
0.2
0
1
2
3
4
5
6
7
8
9 10 11 12
Number of future events
Event Forecasting with Pattern Markov Chains
Implementation
Example: R = a · b · b · b.
a
a
a
start
0
a
1
b
2
b
3
b
4
a
b
b
Completion Probability
1
state:3
interval:1,1
0.8
0.6
0.4
0.2
0
1
2
3
4
5
6
7
8
9 10 11 12
Number of future events
Event Forecasting with Pattern Markov Chains
Empirical Analysis
Credit Card Fraud Management: Real Dataset (m = 1).
Prediction Threshold
100
0.8
80
0.6
60
0.4
40
20
0.2
0
0
1
2
3
4
5
6
7
State
10
8
0.6
6
0.4
4
2
0.2
Prediction Threshold
Prediction Threshold
15
0.8
0.8
10
0.6
0.4
5
0.2
0
0
1
2
3
4
State
5
6
7
0
0
1
2
3
4
State
5
6
7
Event Forecasting with Pattern Markov Chains
Empirical Analysis
Credit Card Fraud Management: Real Dataset (m = 3).
Prediction Threshold
100
0.8
80
0.6
60
0.4
40
20
0.2
0
1 11 12 13 2 21 3
0
4
5
6
7
State
10
8
0.6
6
0.4
4
2
0.2
Prediction Threshold
Prediction Threshold
15
0.8
0.8
10
0.6
0.4
5
0.2
0
0
1 11 12 13 2 21 3
State
4
5
6
7
0
0
1 11 12 13 2 21 3
State
4
5
6
7
Event Forecasting with Pattern Markov Chains
Empirical Analysis
Maritime Monitoring: Real Dataset.
R = Turn · GapStart · GapEnd · Turn,
where Turn = (TurnNorth + TurnEast + TurnSouth + TurnWest)
Prediction Threshold
100
0.8
80
0.6
60
0.4
40
20
0.2
0
3
te
7
tw
9
tn
11
ts
13
gse
14
gsn
15
gsw
16
gss
17
gen
18
gew
19
ges
20
gee
State
10
300
250
0.6
200
150
0.4
100
0.2
50
Prediction Threshold
Prediction Threshold
350
0.8
0.8
8
0.6
6
0.4
4
2
0.2
0
0
3 te
7 tw
9 tn
11 ts 13 gse 14 gsn 15 gsw 16 gss 17 gen 18 gew 19 ges 20 gee
State
3 te
7 tw
9 tn
11 ts 13 gse 14 gsn 15 gsw 16 gss 17 gen 18 gew 19 ges 20 gee
State
Event Forecasting with Pattern Markov Chains
Empirical Analysis
Summary & Future Work
I
Contributions:
I
I
I
Regular expressions as opposed to sequential patterns.
Forecasts with guaranteed precision, if Markov process.
Useful forecasts even in applications where we do not know
beforehand the stream properties.
Event Forecasting with Pattern Markov Chains
Empirical Analysis
Summary & Future Work
I
Contributions:
I
I
I
I
Regular expressions as opposed to sequential patterns.
Forecasts with guaranteed precision, if Markov process.
Useful forecasts even in applications where we do not know
beforehand the stream properties.
Future work:
I
I
I
I
Constraints on event properties.
More selection strategies.
Support drift.
Forecasts that correspong to real time (not transitions).
Event Forecasting with Pattern Markov Chains
Appendix
Appendix
Event Forecasting with Pattern Markov Chains
Appendix
Validation tests
Precision score
1
order=0
order=1
order=2
f(x)=x
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
Prediction threshold
Figure: R = a · (a + b)∗ · c
Precision score
1
order=0
order=1
order=2
f(x)=x
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
Event Forecasting with Pattern Markov Chains
Appendix
Credit cards (precision for m = 1, 2, 3)
1
0.6
0.4
0.2
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
0
0
0.2
Prediction threshold
1
0.4
0.6
0.4
0.2
0
0
0.6
Prediction threshold
Precision (on recognized)
Precision (on ground truth)
f(x)=x
0.8
Precision score
0
Precision (on recognized)
Precision (on ground truth)
f(x)=x
0.8
Precision score
0.8
Precision score
1
Precision (on recognized)
Precision (on ground truth)
f(x)=x
0.2
0.4
0.6
Prediction threshold
0.8
1
0.8
1
Event Forecasting with Pattern Markov Chains
Appendix
Maritime (precision)
R = Turn · GapStart · GapEnd · Turn
1
Precision
f(x)=x
Precision score
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
Prediction threshold
0.8
1
Event Forecasting with Pattern Markov Chains
Appendix
Maritime (precision)
R = TurnNorth · (TurnNorth + TurnEast)∗ · TurnSouth
Precision score
1
order=1
order=2
f(x)=x
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
Prediction threshold
0.8
1
© Copyright 2026 Paperzz