-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathfrequency_maps.Rmd
135 lines (89 loc) · 4.58 KB
/
frequency_maps.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
title: "bupaR Docs | Frequency Maps"
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/pm.PNG")
```
***
# Frequency maps
```{r include = F}
library(bupaverse)
knitr::opts_chunk$set(fig.height=3)
```
```{r eval = F}
library(bupaverse)
```
A process map of a log can be created using `process_map()`. A process map is a directly-follows graph, where each distinct activity is represented by a node, and each directly-follows relationship between activities is shown by directed edges, i.e. arrows between the nodes.
Below we explain how process maps can be used to show frequent (and infrequent) flows in the process. You can also use them to visualize [performance](performance_maps.html) or more [advanced analyses](advanced analysis).
Six different flavors of frequency process map can be considered:
* __absolute__ frequency
* __Nodes__: The absolute number of activity instance executions
* __Flows__: The absolute number of times source and target activities were executed directly following each other.
* __absolute-case__ frequency
* __Nodes__: The absolute number of cases in which the activity was executed
* __Flows__: The absolute number of cases in which source and target activity were executed directly following each other.
* __relative__ frequency
* __Nodes__: The proportion of all activity instances that had this type
* __Flows__: The proportion of source executions directly followed by target executions.
* __relative-case__ frequency
* __Nodes__: The proportion of cases in which the activity was executed
* __Flows__: The proportion of cases in which source and target activities were executed directly following each other.
* __relative-antecedent__ frequency (= _relative_)
* __Nodes__: The proportion of all activity instances that had this type
* __Flows__: The proportion of source executions directly followed by target executions.
* __relative-consequent__ frequency
* __Nodes__: The proportion of all activity instances that had this type
* __Flows__: The proportion of target executions that was preceded by an execution of source.
Each of these flavors can be configured by passing `type = frequency()` to `process_map()`, and additionally specifying the type of `frequency()` (ex. "absolute", "absolute-case", etc.)
In the examples below, we will use a slightly filtered versions of the `traffic_fines` data set, which contains 95% of the cases that have [the most frequent traces.](case_filters.html#Trace_Frequency)
```{r}
tmp <- traffic_fines %>%
filter_trace_frequency(percentage = 0.95)
```
## Absolute
Below you can see the __absolute__ frequency map. Let's focus on the _Payment_ activity. We see it was executed 4686 times. It was followed by another payment 250 times, while it was also the end of the case in 4436 times.
```{r}
tmp %>%
process_map(frequency("absolute"))
```
Note that this is the default process map configuration, and is thus equivalent to the following.
```{r}
tmp %>%
process_map()
```
## Absolute case
Looking at the __absolute-case__ process map below, we see that the _Payment_ activity is only executed in 4436 cases. This number is lower than the total number of executions seen above because of the self-loop on the activity.
```{r}
tmp %>%
process_map(frequency("absolute-case"))
```
## Relative
In relative terms, _Payment_ represents 14.51% of the total activity instances. We can furthermore see that in 94.66% of cases it occurred, it was the end of the case. In the other 5.34% of cases, it was followed by another Payment.
```{r}
tmp %>%
process_map(frequency("relative"))
```
## Relative case
Below, we see that _Payment_ occurred in 46.24% of cases. In 2.5% of cases, a _Payment_ activity was followed by another _Payment._
```{r}
tmp %>%
process_map(frequency("relative-case"))
```
## Relative antecedence
See [relative.](frequency_maps.html#Relative) Relative-antecedence is included as an option in symmetry with relative-consequent.
## Relative consequent
Finally, the __relative-consequent__ map shows us what happens _before_ activities. With respect to _Payment_, we can see that it was preceded by:
* _Create Fine_ (73.15%)
* _Add Penalty_ (21.51%)
* _Payment_ (5.34%)
_Payment_ itself represents 14.51% of all activity executions.
```{r}
tmp %>%
process_map(frequency("relative-consequent"))
```
```{r footer, results = "asis", echo = F}
CURRENT_PAGE <- stringr::str_replace(knitr::current_input(), ".Rmd",".html")
res <- knitr::knit_expand("_button_footer.Rmd", quiet = TRUE)
res <- knitr::knit_child(text = unlist(res), quiet = TRUE)
cat(res, sep = '\n')
```