Creates a Causal net, also known as Heuristics net. This is similar to a processmapR process map. However, the causal map deals with parallelism by trying to identifying causal dependencies between activities by using different heuristics as documented in dependency_matrix.

causal_net(
  eventlog = NULL,
  dependencies = dependency_matrix(eventlog = eventlog, threshold = threshold,
    threshold_frequency = threshold_frequency, ...),
  bindings = causal_bindings(eventlog, dependencies),
  threshold = 0.9,
  threshold_frequency = 0,
  type = causal_frequency("absolute"),
  sec = NULL,
  type_nodes = type,
  type_edges = type,
  sec_nodes = sec,
  sec_edges = sec,
  ...
)

Arguments

eventlog

The event log for which a causal map should be computed. Can be left NULL for more control if parameters dependencies and bindings are provided directly.

dependencies

A dependency matrix created for the event log, for example, by dependency_matrix.

bindings

Causal bindings created by causal_bindings.

threshold

The dependency threshold to be used when using the default dependency matrix computation.

threshold_frequency

The frequency threshold to be used when using the default dependency matrix computation.

type

A causal map type. For example, causal_frequency or causal_performance.

sec

A causal process map type. Values are shown between brackets.

type_nodes

A causal map type to be used for nodes only.

type_edges

A causal map type to be used for edges only.

sec_nodes

A secondary causal map type for nodes only.

sec_edges

A secondary causal map type for edges only.

...

Further parameters forwarded to the default dependency_matrix function.

Value

A DiagrammeR graph of the causal map.

Details

Warning: Projected frequencies are heuristically determined and counts may not add up.

Examples

# Causal map with default parameters causal_net(L_heur_1)
#> Nodes #> # A tibble: 7 x 12 #> act from_id n n_distinct_cases bindings_input bindings_output label #> <chr> <int> <dbl> <dbl> <list> <list> <chr> #> 1 a 1 40 40 <list [1]> <list [4]> "a\n40" #> 2 b 2 21 21 <list [1]> <list [1]> "b\n21" #> 3 c 3 21 21 <list [1]> <list [1]> "c\n21" #> 4 d 4 17 13 <list [1]> <list [1]> "d\n17" #> 5 e 5 40 40 <list [4]> <list [1]> "e\n40" #> 6 End 6 40 40 <list [1]> <list [0]> "End" #> 7 Start 7 40 40 <list [0]> <list [1]> "Start" #> # ... with 5 more variables: color_level <dbl>, shape <chr>, fontcolor <chr>, #> # color <chr>, tooltip <chr> #> Edges #> # A tibble: 8 x 8 #> antecedent consequent dep from_id to_id n label penwidth #> <chr> <chr> <dbl> <int> <int> <dbl> <chr> <dbl> #> 1 Start a 0.976 7 1 40 40 5 #> 2 a b 0.917 1 2 21 21 3.1 #> 3 a c 0.917 1 3 21 21 3.1 #> 4 a d 0.929 1 4 13 13 2.3 #> 5 b e 0.917 2 5 21 21 3.1 #> 6 c e 0.917 3 5 21 21 3.1 #> 7 d e 0.929 4 5 17 17 2.7 #> 8 e End 0.976 5 6 40 40 5
# Causal map with lower dependency treshold causal_net(L_heur_1, threshold = .8)
#> Nodes #> # A tibble: 7 x 12 #> act from_id n n_distinct_cases bindings_input bindings_output label #> <chr> <int> <dbl> <dbl> <list> <list> <chr> #> 1 a 1 40 40 <list [1]> <list [5]> "a\n40" #> 2 b 2 21 21 <list [1]> <list [1]> "b\n21" #> 3 c 3 21 21 <list [1]> <list [1]> "c\n21" #> 4 d 4 17 13 <list [2]> <list [2]> "d\n17" #> 5 e 5 40 40 <list [5]> <list [1]> "e\n40" #> 6 End 6 40 40 <list [1]> <list [0]> "End" #> 7 Start 7 40 40 <list [0]> <list [1]> "Start" #> # ... with 5 more variables: color_level <dbl>, shape <chr>, fontcolor <chr>, #> # color <chr>, tooltip <chr> #> Edges #> # A tibble: 10 x 8 #> antecedent consequent dep from_id to_id n label penwidth #> <chr> <chr> <dbl> <int> <int> <dbl> <chr> <dbl> #> 1 Start a 0.976 7 1 40 40 5 #> 2 a b 0.917 1 2 21 21 3.1 #> 3 a c 0.917 1 3 21 21 3.1 #> 4 a d 0.929 1 4 13 13 2.3 #> 5 d d 0.8 4 4 4 4 1.4 #> 6 a e 0.833 1 5 5 5 1.5 #> 7 b e 0.917 2 5 21 21 3.1 #> 8 c e 0.917 3 5 21 21 3.1 #> 9 d e 0.929 4 5 13 13 2.3 #> 10 e End 0.976 5 6 40 40 5
# For even more control omit the `eventlog` parameter # and provide `dependencies` and `bindings` directly. d <- dependency_matrix(L_heur_1, threshold = .8) causal_net(dependencies = d, bindings = causal_bindings(L_heur_1, d, "nearest"))
#> Nodes #> # A tibble: 7 x 12 #> act from_id n n_distinct_cases bindings_input bindings_output label #> <chr> <int> <dbl> <dbl> <list> <list> <chr> #> 1 a 1 40 40 <list [1]> <list [5]> "a\n40" #> 2 b 2 21 21 <list [1]> <list [1]> "b\n21" #> 3 c 3 21 21 <list [1]> <list [1]> "c\n21" #> 4 d 4 17 13 <list [2]> <list [2]> "d\n17" #> 5 e 5 40 40 <list [5]> <list [1]> "e\n40" #> 6 End 6 40 40 <list [1]> <list [0]> "End" #> 7 Start 7 40 40 <list [0]> <list [1]> "Start" #> # ... with 5 more variables: color_level <dbl>, shape <chr>, fontcolor <chr>, #> # color <chr>, tooltip <chr> #> Edges #> # A tibble: 10 x 8 #> antecedent consequent dep from_id to_id n label penwidth #> <chr> <chr> <dbl> <int> <int> <dbl> <chr> <dbl> #> 1 Start a 0.976 7 1 40 40 5 #> 2 a b 0.917 1 2 21 21 3.1 #> 3 a c 0.917 1 3 21 21 3.1 #> 4 a d 0.929 1 4 13 13 2.3 #> 5 d d 0.8 4 4 4 4 1.4 #> 6 a e 0.833 1 5 5 5 1.5 #> 7 b e 0.917 2 5 21 21 3.1 #> 8 c e 0.917 3 5 21 21 3.1 #> 9 d e 0.929 4 5 13 13 2.3 #> 10 e End 0.976 5 6 40 40 5
# The returned DiagrammeR object can be further augmented with # panning and zooming before rendering: # \donttest{ library(magrittr) causal_net(L_heur_1) %>% render_causal_net(render = TRUE) %>% DiagrammeRsvg::export_svg() %>% svgPanZoom::svgPanZoom() # }