Updated scripts and bibfile

This commit is contained in:
Nora Wickelmaier 2023-12-21 13:45:40 +01:00
parent 7a4859227a
commit 9c6466bca9
2 changed files with 38 additions and 7 deletions

View File

@ -49,12 +49,18 @@ h_eval = eval_pm(event_log, net, im, fm)
pm4py.vis.view_petri_net(net, im, fm)
pm4py.vis.save_vis_petri_net(net, im, fm, "../figures/processmaps/pn_heuristics_complete.png")
is_sound = pm4py.check_soundness(net, im, fm)
# decorated petri net
from pm4py.visualization.petri_net import visualizer as pn_visualizer
parameters = {pn_visualizer.Variants.FREQUENCY.value.Parameters.FORMAT: "png"}
gviz = pn_visualizer.apply(net, im, fm, parameters=parameters, variant=pn_visualizer.Variants.FREQUENCY, log=event_log)
pn_visualizer.save(gviz, "../figures/processmaps/pn_heuristics_complete_decorated.png")
# convert to process tree
bpmn = pm4py.convert.convert_to_bpmn(net, im, fm)
pm4py.vis.view_bpmn(bpmn)
## Alpha Miner
net, im, fm = pm4py.discover_petri_net_alpha(event_log)
a_eval = eval_pm(event_log, net, im, fm)
@ -67,6 +73,9 @@ i_eval = eval_pm(event_log, net, im, fm)
pm4py.vis.view_petri_net(net, im, fm)
pm4py.vis.save_vis_petri_net(net, im, fm, "../figures/processmaps/pn_induction_complete.png")
# as process tree (does not work for heuristics miner!)
pt = pm4py.discover_process_tree_inductive(event_log)
pm4py.vis.view_process_tree(pt)
## ILP Miner
net, im, fm = pm4py.discover_petri_net_ilp(event_log)

View File

@ -1,14 +1,25 @@
# 00_current_analysis.R
# 01_clustering.R
#
# content: (1) Read evalutation data
# content: (1) Read evaluation data
# (2) Clustering
# (3) Visualization with pictures
# (4) Read event logs
# (5) Frequency plot for clusters
# (6) DFGs for clusters
#
# input: results/eval_heuristics_artworks.csv
# results/eval_all-miners_complete.csv
# output: --
# ../data/haum/event_logfiles_glossar_2023-11-03_17-46-28.csv
# output: ../figures/clustering_heuristics.pdf
# ../figures/clustering_heuristics.png
# ../figures/processmaps/dfg_complete_R.pdf
# ../figures/processmaps/dfg_complete_R.png
# ../figures/processmaps/dfg_cluster1_R.pdf
# ../figures/processmaps/dfg_cluster2_R.pdf
# ../figures/processmaps/dfg_cluster3_R.pdf
# ../figures/processmaps/dfg_cluster4_R.pdf
#
# last mod: 2023-12-08, NW
# last mod: 2023-12-21, NW
# setwd("C:/Users/nwickelmaier/Nextcloud/Documents/MDS/2023ss/60100_master_thesis/code")
@ -162,15 +173,22 @@ dat_count$cluster <- factor(dat_count$cluster, levels = c(4, 2, 1, 3), labels =
dat_count <- dat_count[order(dat_count$cluster, dat_count$freq, decreasing = TRUE), ]
dat_count$artwork <- factor(dat_count$artwork, levels = unique(dat_count$artwork))
png("../figures/counts_artworks_clusters.png", units = "in", height = 3.375, width = 12, pointsize = 10, res = 300)
par(mai = c(.6,.6,.1,.1), mgp = c(2.4, 1, 0))
barplot(freq ~ artwork, dat_count, las = 2, ylim = c(0, 60000),
border = "white", ylab = "",
col = c("#FF6900", "#78004B", "#3CB4DC", "#91C86E" )[dat_count$cluster])
dev.off()
# compare to clusters
png("../figures/pm_heuristics_clusters.png", units = "in", height = 3.375, width = 3.375, pointsize = 10, res = 300)
par(mai = c(.6,.6,.1,.1), mgp = c(2.4, 1, 0))
plot(generalizability ~ precision, eval_heuristics, type = "n", ylim = c(0.845, 0.98))
with(eval_heuristics, text(precision, generalizability,
rownames(eval_heuristics),
col = colors[k1$cluster]))
dev.off()
#--------------- (6) DFGs for clusters ---------------
@ -202,12 +220,16 @@ dfg_complete <- process_map(alog,
sec_nodes = frequency("relative"),
type_edges = frequency("absolute", color_edges = "#FF6900"),
sec_edges = frequency("relative"),
rankdir = "TB",
#rankdir = "TB",
render = FALSE)
export_map(dfg_complete,
file_name = "../figures/processmaps/dfg_complete_R.pdf",
file_type = "pdf",
title = "DFG complete")
export_map(dfg_complete,
file_name = "../figures/processmaps/dfg_complete_R.png",
file_type = "png")
dfg_c1 <- process_map(alog_c1,
type_nodes = frequency("absolute", color_scale = "Greys"),
sec_nodes = frequency("relative"),