How to tame process mining technology in an enterprise using R?

It somehow happened that in 2020 there was a surge of interest in the subject of Process Mining. It is possible that the new reality of remote mode required a closer assessment of the efficiency of technological and business processes. It's the same as with curved and oblique wooden frames. It runs through all the cracks, and the meter winds up megawatts for heating.



In general, there are several popular requests for the application of process mining technology:



  • I want to improve something, but have not heard anything other than a buzzword;
  • get or save "real money" by optimizing the classic "order-to-cash" process and the like;
  • system audit of everything and everything by our own team of auditors;
  • building operational analytics and monitoring based on process indicators, not IT metrics.


In 99% of cases, they start reading Gartner / Forrester and get to the top 4 vendors (Celonis / Minit / Software AG / UiPath), which are somehow present in Russia. And before they start receiving any benefit, they immediately receive a rather big price tag for licenses and subsequent annual support. At the same time, the economic justification is sewn with white threads.



Is it really necessary to go this way? Especially when the tasks and goals are not fully understood by the directors themselves. Do not forget that vendors require a specially prepared event log, and its preparation can result in a headache and many months of integration work in a classic enterprise landscape.



It is a continuation of previous publications .



Preamble



process mining ?

, . 90% 100% open-source . R . HR . .



, , . , .



« 1- 30- », R process mining -.



.





-, , :



  • (= ) ;
  • ;
  • ;
  • ;
  • ;
  • .


:





. , , . , process-mining data-science .



, :



  • , ETL - ;
  • 2- 3- , «-» ;
  • « » ;
  • .




process-mining . data science , , , open-source R Tidyverse. , open-source . 10 , . , process-mining , , process mining office (PMO).



PMO . , data science « », .. () , .



, process-mining , . data science , PMO R tidyverse Excel.



R process mining:



  • (open-source);
  • ( , );
  • ( 10-100 «» );
  • ( , « »);
  • ( , R > 10 . , /, , , , web , ...).




csv, :



read_csv("./data/pmo/pmo_sales.csv")




xlsx, :



read_excel("./data/pmo/pmo_sales.xlsx", sheet = " ")




: MS SQL, PostgreS, Oracle, MySQL, Access, Redis, Clickhouse,… "Databases using R" (https://db.rstudio.com/)





() . :





mutate — .



df <- read_csv("./data/pmo/pmo_sales.csv") %>%
  #    
  mutate(amount = unitprice * weight)
df


mutate



group_by — , summarise — .



#    
df %>% 
  group_by(item) %>%
  summarise(sum(weight), sum(amount))


group_by



select — .



df %>%
  select("" = date, ", " = amount, item)


select



filter — .



df %>%
  filter(amount > 1000, item == "")


filter



arrange — .



df %>%
  arrange(date, desc(amount))


arrange





df %>% 
  group_by(item) %>%
  gt(rowname_col = "date")






gp <- ggplot(df, aes(date, amount, color = item, fill = item)) +
  geom_point(size = 4, shape = 19, alpha = 0.7) +
  geom_line(lwd = 1.1) +
  scale_x_date(date_breaks = "1 day", date_minor_breaks = "1 day", date_labels = "%d") +
  scale_y_continuous(breaks = scales::pretty_breaks(10)) +
  ggthemes::scale_color_tableau() +
  ggthemes::scale_fill_tableau() +
  theme_bw()

gp






gp + facet_wrap(~item) + geom_area(alpha = 0.3)








df <- read_csv("./data/pmo/pmo_school.csv")
df




activity resourse



df %>% 
  mutate(new_activity = glue("{activity} - {resource}")) %>%
  count(new_activity, sort = TRUE)




?



df %>%
  mutate(hr = hour(timestamp), date = as_date(timestamp)) %>%
  group_by(date) %>%
  #    
  filter(timestamp == max(timestamp)) %>%
  ungroup() %>%
  select(date, hr, everything(), -timestamp, -part)




DWG bupaR (https://www.bupar.net)



.



patients






patients %>%
    process_map()


patients





patients %>%
    process_map(performance(median, "days"))




P.S.



  1. , , . enterprise. .
  2. , «- enterprise : . R»
  3. process mining , Wil M. P. van der Aalst «Process Mining: Data Science in Action». , , .. , .


Previous post - "Package-Package-Package ... How Effectively Are You Using R?" ...




All Articles