-
Notifications
You must be signed in to change notification settings - Fork 11
/
trace_explorer.Rmd
113 lines (79 loc) · 2.43 KB
/
trace_explorer.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
---
title: "bupaR Docs | Trace Explorer"
---
```{r echo = F, out.width="25%", fig.align = "right"}
knitr::include_graphics("images/icons/traces.PNG")
```
***
# Trace exlorer
```{r include = F}
library(bupaverse)
knitr::opts_chunk$set(out.width = "80%", fig.asp = 0.6)
```
```{r eval = F}
library(bupaverse)
```
```{r echo = F}
knitr::opts_chunk$set(fig.width = 9)
```
Different activity sequences in the log can be visualized with `trace_explorer()`. It can be used to explore frequent as well as infrequent traces.
## Set coverage
The `coverage` argument specifies how much of the log you want to explore. By default it is set at 0.2, meaning that it will show the most frequent traces covering 20% of the event log.
```{r fig.heigth = 6}
sepsis %>%
trace_explorer()
sepsis %>%
trace_explorer(coverage = 0.15)
```
You can also set the coverage by directly specifying the number of traces to show.
```{r}
sepsis %>%
trace_explorer(n_traces = 10)
```
Instead of giving priority to frequent traces, you can show infrequent traces.
```{r}
sepsis %>%
trace_explorer(n_traces = 10, type = "infrequent")
```
## Set metrics
The `trace_explorer()` shows three metrics by default:
* relative coverage of the trace
* absolute coverage of the trace
* cumulative coverage of this and previous traces
You can set which metric to include using `coverage_labels`, as well as change the order.
```{r}
sepsis %>%
trace_explorer(n_traces = 10,
coverage_labels = c("cumulative", "relative"))
```
## Set labels
The labels shown on the traces can be configured with the arguments `label_size`, `show_labels` and `abbreviate`.
Increasing the label size.
```{r}
sepsis %>%
trace_explorer(n_traces = 10, label_size = 4)
```
Removing the labels.
```{r}
sepsis %>%
trace_explorer(n_traces = 10,
show_labels = FALSE)
```
Disabling the abbreviation of labels.
```{r}
sepsis %>%
trace_explorer(n_traces = 10, abbreviate = FALSE)
```
## Set the colors
The colors used can be change by providing a discrete fill scale to `scale_fill`. The example below uses the default `ggplot2` scale.
```{r}
sepsis %>%
trace_explorer(n_traces = 10,
scale_fill = ggplot2::scale_fill_discrete)
```
```{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')
```