From d06b302f99c9cef9eda7221f753b594d21150b65 Mon Sep 17 00:00:00 2001 From: assynour Date: Tue, 3 Oct 2023 14:36:15 +0200 Subject: [PATCH] Add process mining handson material --- processmining-handson/loan-app-diagram.bpmn | 268 ++++++++++++++++++ .../loan-app-process-data.csv | 225 +++++++++++++++ .../process-mining-handson.Rmd | 156 ++++++++++ 3 files changed, 649 insertions(+) create mode 100644 processmining-handson/loan-app-diagram.bpmn create mode 100644 processmining-handson/loan-app-process-data.csv create mode 100644 processmining-handson/process-mining-handson.Rmd diff --git a/processmining-handson/loan-app-diagram.bpmn b/processmining-handson/loan-app-diagram.bpmn new file mode 100644 index 0000000..02d8bab --- /dev/null +++ b/processmining-handson/loan-app-diagram.bpmn @@ -0,0 +1,268 @@ + + + + + + This is an example of actor that is mapped to any ACME users + + + + + + + + + + + + + + + + + + + _q7tlqAkhEe6jMYUrrhrEhg + + + _q7tlqwkhEe6jMYUrrhrEhg + + + _q7tlrgkhEe6jMYUrrhrEhg + + + _q7tlsQkhEe6jMYUrrhrEhg + + + + _OFMGALa-Ee2LTL59tz3FnA + + + + + + + + + + _o-_wO7a1Ee2LTL59tz3FnA + + + + + _o-_wO7a1Ee2LTL59tz3FnA + + + + + + + + + + _o-_wO7a1Ee2LTL59tz3FnA + + + + + _OFMGALa-Ee2LTL59tz3FnA + + + + + + + _o-_wO7a1Ee2LTL59tz3FnA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/processmining-handson/loan-app-process-data.csv b/processmining-handson/loan-app-process-data.csv new file mode 100644 index 0000000..c682d57 --- /dev/null +++ b/processmining-handson/loan-app-process-data.csv @@ -0,0 +1,225 @@ +loanID,activity,startTime,completeTime,loanAmount,loanDuration,loanType,loanValidated,loanReviewedAndValidated +0,Request a loan,2023/06/11 9:00:00,2023/06/11 12:00:00,10000,12,personal,, +0,Validate loan request,2023/06/12 9:00:00,2023/06/14 15:00:00,,,,yes, +0,Write loan contract,2023/06/15 9:00:00,2023/06/16 17:00:00,,,,, +0,Sign contract,2023/06/17 9:00:00,2023/06/17 10:00:00,,,,, +0,Notify expiracy,2023/06/18 9:00:00,2023/06/18 10:00:00,,,,, +1,Request a loan,2023/06/19 9:00:00,2023/06/19 12:00:00,30000,48,home,, +1,Validate loan request,2023/06/20 9:00:00,2023/06/22 15:00:00,,,,no, +1,Notify refusal,2023/06/23 9:00:00,2023/06/23 10:00:00,,,,, +2,Request a loan,2023/06/24 9:00:00,2023/06/24 12:00:00,100000,36,business,, +2,Review loan request,2023/06/25 9:00:00,2023/06/27 15:00:00,,,,,no +2,Notify refusal,2023/06/28 9:00:00,2023/06/28 10:00:00,,,,, +3,Request a loan,2023/06/29 9:00:00,2023/06/29 12:00:00,100000,120,business,, +3,Validate loan request,2023/06/30 9:00:00,2023/07/02 15:00:00,,,,no, +3,Notify refusal,2023/07/03 9:00:00,2023/07/03 10:00:00,,,,, +4,Request a loan,2023/07/04 9:00:00,2023/07/04 12:00:00,5000,9,personal,, +4,Validate loan request,2023/07/05 9:00:00,2023/07/07 15:00:00,,,,yes, +4,Write loan contract,2023/07/08 9:00:00,2023/07/09 17:00:00,,,,, +4,Sign contract,2023/07/10 9:00:00,2023/07/10 10:00:00,,,,, +4,Validate contract,2023/07/11 9:00:00,2023/07/11 17:00:00,,,,, +4,Credit funds,2023/07/12 9:00:00,2023/07/12 17:00:00,,,,, +5,Request a loan,2023/07/13 9:00:00,2023/07/13 12:00:00,7000,12,personal,, +5,Validate loan request,2023/07/14 9:00:00,2023/07/16 15:00:00,,,,yes, +5,Write loan contract,2023/07/17 9:00:00,2023/07/18 17:00:00,,,,, +5,Sign contract,2023/07/19 9:00:00,2023/07/19 10:00:00,,,,, +5,Validate contract,2023/07/20 9:00:00,2023/07/20 17:00:00,,,,, +5,Credit funds,2023/07/21 9:00:00,2023/07/21 17:00:00,,,,, +6,Request a loan,2023/07/24 9:00:00,2023/07/24 12:00:00,75000,18,business,, +6,Review loan request,2023/07/25 9:00:00,2023/07/27 15:00:00,,,,,no +6,Notify refusal,2023/07/28 9:00:00,2023/07/28 10:00:00,,,,, +7,Request a loan,2023/07/29 9:00:00,2023/07/29 12:00:00,200000,35,home,, +7,Review loan request,2023/07/30 9:00:00,2023/08/01 15:00:00,,,,,no +7,Notify refusal,2023/08/02 9:00:00,2023/08/02 10:00:00,,,,, +8,Request a loan,2023/08/03 9:00:00,2023/08/03 12:00:00,55000,36,business,, +8,Validate loan request,2023/08/04 9:00:00,2023/08/06 15:00:00,,,,no, +8,Notify refusal,2023/08/07 9:00:00,2023/08/07 10:00:00,,,,, +9,Request a loan,2023/08/08 9:00:00,2023/08/08 12:00:00,15000,24,business,, +9,Validate loan request,2023/08/09 9:00:00,2023/08/11 15:00:00,,,,yes, +9,Write loan contract,2023/08/12 9:00:00,2023/08/13 17:00:00,,,,, +9,Sign contract,2023/08/14 9:00:00,2023/08/14 10:00:00,,,,, +9,Notify expiracy,2023/08/15 9:00:00,2023/08/15 10:00:00,,,,, +10,Request a loan,2023/08/16 9:00:00,2023/08/16 12:00:00,80000,18,business,, +10,Review loan request,2023/08/17 9:00:00,2023/08/19 15:00:00,,,,,no +10,Notify refusal,2023/08/20 9:00:00,2023/08/20 10:00:00,,,,, +11,Request a loan,2023/08/21 9:00:00,2023/08/21 12:00:00,6000,12,personal,, +11,Validate loan request,2023/08/22 9:00:00,2023/08/24 15:00:00,,,,yes, +11,Write loan contract,2023/08/25 9:00:00,2023/08/26 17:00:00,,,,, +11,Sign contract,2023/08/27 9:00:00,2023/08/27 10:00:00,,,,, +11,Notify expiracy,2023/08/28 9:00:00,2023/08/28 10:00:00,,,,, +12,Request a loan,2023/08/29 9:00:00,2023/08/29 12:00:00,55000,24,home,, +12,Review loan request,2023/08/30 9:00:00,2023/09/01 15:00:00,,,,,yes +12,Write loan contract,2023/09/02 9:00:00,2023/09/03 17:00:00,,,,, +12,Sign contract,2023/09/04 9:00:00,2023/09/04 10:00:00,,,,, +12,Notify expiracy,2023/09/05 9:00:00,2023/09/05 10:00:00,,,,, +13,Request a loan,2023/09/06 9:00:00,2023/09/06 12:00:00,95000,18,business,, +13,Review loan request,2023/09/07 9:00:00,2023/09/09 15:00:00,,,,,no +13,Notify refusal,2023/09/10 9:00:00,2023/09/10 10:00:00,,,,, +14,Request a loan,2023/09/11 9:00:00,2023/09/11 12:00:00,25000,36,auto,, +14,Validate loan request,2023/09/12 9:00:00,2023/09/14 15:00:00,,,,no, +14,Notify refusal,2023/09/15 9:00:00,2023/09/15 10:00:00,,,,, +15,Request a loan,2023/09/16 9:00:00,2023/09/16 12:00:00,60000,24,business,, +15,Review loan request,2023/09/17 9:00:00,2023/09/19 15:00:00,,,,,yes +15,Write loan contract,2023/09/20 9:00:00,2023/09/21 17:00:00,,,,, +15,Sign contract,2023/09/22 9:00:00,2023/09/22 10:00:00,,,,, +15,Notify expiracy,2023/09/23 9:00:00,2023/09/23 10:00:00,30000,40,auto,, +16,Request a loan,2023/06/11 9:00:00,2023/06/11 9:05:00,,,,no, +16,Validate loan request,2023/06/11 9:05:00,2023/06/11 10:00:00,,,,, +16,Notify refusal,2023/06/11 10:00:00,2023/06/11 10:05:00,,,,, +17,Request a loan,2023/06/11 9:15:00,2023/06/11 9:20:00,100000,18,business,, +17,Review loan request,2023/06/11 9:20:00,2023/06/11 11:20:00,,,,,no +17,Notify refusal,2023/06/11 11:20:00,2023/06/11 11:25:00,,,,, +18,Request a loan,2023/06/11 9:30:00,2023/06/11 9:35:00,7500,18,auto,, +18,Validate loan request,2023/06/11 9:35:00,2023/06/11 12:35:00,,,,yes, +18,Write loan contract,2023/06/11 12:35:00,2023/06/11 13:35:00,,,,, +18,Sign contract,2023/06/11 13:35:00,2023/06/11 13:40:00,,,,, +18,Notify expiracy,2023/06/11 13:40:00,2023/06/11 13:45:00,,,,, +19,Request a loan,2023/06/11 10:00:00,2023/06/11 10:10:00,50000,18,business,, +19,Review loan request,2023/06/11 10:10:00,2023/06/11 12:00:00,,,,,yes +19,Write loan contract,2023/06/11 12:00:00,2023/06/11 14:00:00,,,,, +19,Sign contract,2023/06/11 14:00:00,2023/06/11 14:10:00,,,,, +19,Notify expiracy,2023/06/11 14:10:00,2023/06/11 14:15:00,,,,, +20,Request a loan,2023/06/11 10:30:00,2023/06/11 10:40:00,75000,36,home,, +20,Validate loan request,2023/06/11 10:40:00,2023/06/11 11:40:00,,,,no, +20,Notify refusal,2023/06/11 11:40:00,2023/06/11 11:45:00,,,,, +21,Request a loan,2023/06/11 11:00:00,2023/06/11 11:10:00,60000,60,business,, +21,Validate loan request,2023/06/11 11:10:00,2023/06/11 12:10:00,,,,no, +21,Notify refusal,2023/06/11 12:10:00,2023/06/11 12:15:00,,,,, +16,Request a loan,2023/06/11 9:00:00,2023/06/11 9:05:00,75000,30,home,, +16,Validate loan request,2023/06/11 9:05:00,2023/06/11 10:00:00,,,,,yes +16,Notify refusal,2023/06/11 10:00:00,2023/06/11 10:05:00,,,,, +17,Request a loan,2023/06/11 9:15:00,2023/06/11 9:20:00,,,,, +17,Review loan request,2023/06/11 9:20:00,2023/06/11 11:20:00,,,,, +17,Notify refusal,2023/06/11 11:20:00,2023/06/11 11:25:00,,,,, +18,Request a loan,2023/06/11 9:30:00,2023/06/11 9:35:00,50000,54,home,, +18,Validate loan request,2023/06/11 9:35:00,2023/06/11 12:35:00,,,,no, +18,Write loan contract,2023/06/11 12:35:00,2023/06/11 13:35:00,,,,, +18,Sign contract,2023/06/11 13:35:00,2023/06/11 13:40:00,12000,12,auto,, +18,Notify expiracy,2023/06/11 13:40:00,2023/06/11 13:45:00,,,,yes, +19,Request a loan,2023/06/11 10:00:00,2023/06/11 10:10:00,,,,, +19,Review loan request,2023/06/11 10:10:00,2023/06/11 12:00:00,,,,, +19,Write loan contract,2023/06/11 12:00:00,2023/06/11 14:00:00,,,,, +19,Sign contract,2023/06/11 14:00:00,2023/06/11 14:10:00,,,,, +19,Notify expiracy,2023/06/11 14:10:00,2023/06/11 14:15:00,5000,12,personal,, +20,Request a loan,2023/06/11 10:30:00,2023/06/11 10:40:00,,,,yes, +20,Validate loan request,2023/06/11 10:40:00,2023/06/11 11:40:00,,,,, +20,Notify refusal,2023/06/11 11:40:00,2023/06/11 11:45:00,,,,, +21,Request a loan,2023/06/11 11:00:00,2023/06/11 11:10:00,,,,, +21,Validate loan request,2023/06/11 11:10:00,2023/06/11 12:10:00,,,,, +21,Notify refusal,2023/06/11 12:10:00,2023/06/11 12:15:00,100000,20,business,, +22,Request a loan,2023/06/11 10:20:45,2023/06/11 10:50:00,,,,,no +22,Review loan request,2023/06/11 11:10:00,2023/06/11 12:10:00,,,,, +22,Write loan contract,2023/06/11 12:40:00,2023/06/11 13:40:00,100000,20,business,, +22,Sign contract,2023/06/11 14:10:00,2023/06/11 14:20:00,,,,,no +22,Validate contract,2023/06/11 14:50:00,2023/06/11 15:50:00,,,,, +22,Credit funds,2023/06/11 16:20:00,2023/06/11 16:30:00,20000,36,auto,, +23,Request a loan,2023/06/11 17:00:00,2023/06/11 17:20:00,,,,no, +23,Validate loan request,2023/06/11 17:50:00,2023/06/11 18:50:00,,,,, +23,Notify refusal,2023/06/11 19:20:00,2023/06/11 19:30:00,75000,24,business,, +24,Request a loan,2023/06/11 20:00:00,2023/06/11 20:20:00,,,,,yes +24,Validate loan request,2023/06/11 20:50:00,2023/06/11 21:50:00,,,,, +24,Write loan contract,2023/06/11 22:20:00,2023/06/11 23:20:00,,,,, +24,Sign contract,2023/06/12 9:50:00,2023/06/12 10:00:00,,,,, +24,Validate contract,2023/06/12 10:30:00,2023/06/12 11:30:00,60000,30,home,, +24,Credit funds,2023/06/12 12:00:00,2023/06/12 12:10:00,,,,,yes +25,Request a loan,2023/06/12 12:40:00,2023/06/12 13:00:00,,,,, +25,Validate loan request,2023/06/12 13:30:00,2023/06/12 14:30:00,,,,, +25,Write loan contract,2023/06/12 15:00:00,2023/06/12 16:00:00,,,,, +25,Sign contract,2023/06/12 16:30:00,2023/06/12 16:40:00,,,,, +25,Validate contract,2023/06/12 17:10:00,2023/06/12 18:10:00,100000,20,business,, +25,Credit funds,2023/06/12 18:40:00,2023/06/12 18:50:00,,,,,no +26,Request a loan,2023/06/11 10:26:32,2023/06/11 10:45:00,,,,, +26,Review loan request,2023/06/11 11:00:00,2023/06/11 12:00:00,100000,36,business,, +26,Notify refusal,2023/06/11 12:30:00,2023/06/11 12:40:00,,,,,no +27,Request a loan,2023/06/11 13:00:00,2023/06/11 13:20:00,,,,, +27,Review loan request,2023/06/11 13:45:00,2023/06/11 14:45:00,100000,36,business,, +27,Notify refusal,2023/06/11 15:00:00,2023/06/11 15:10:00,,,,,no +28,Request a loan,2023/06/11 15:30:00,2023/06/11 15:50:00,,,,, +28,Validate loan request,2023/06/11 16:15:00,2023/06/11 17:15:00,200000,35,home,, +28,Notify refusal,2023/06/11 17:45:00,2023/06/11 17:55:00,,,,,no +29,Request a loan,2023/06/11 18:00:00,2023/06/11 18:20:00,,,,, +29,Review loan request,2023/06/11 18:50:00,2023/06/11 19:50:00,60000,30,home,, +29,Write loan contract,2023/06/11 20:20:00,2023/06/11 21:20:00,,,,,yes +29,Sign contract,2023/06/11 21:50:00,2023/06/11 22:00:00,,,,, +29,Notify expiracy,2023/06/11 22:30:00,2023/06/11 22:40:00,,,,, +30,Request a loan,2023/06/12 9:00:00,2023/06/12 9:20:00,,,,, +30,Review loan request,2023/06/12 9:50:00,2023/06/12 10:50:00,200000,35,home,, +30,Write loan contract,2023/06/12 11:20:00,2023/06/12 12:20:00,,,,,no +30,Sign contract,2023/06/12 12:50:00,2023/06/12 13:00:00,,,,, +30,Validate contract,2023/06/12 13:30:00,2023/06/12 14:30:00,75000,24,business,, +30,Credit funds,2023/06/12 15:00:00,2023/06/12 15:10:00,,,,,yes +31,Request a loan,2023/06/11 9:30:04,2023/06/11 9:45:00,,,,, +31,Review loan request,2023/06/11 10:00:00,2023/06/11 10:30:00,,,,, +31,Notify refusal,2023/06/11 10:45:00,2023/06/11 10:55:00,,,,, +32,Request a loan,2023/06/11 11:10:00,2023/06/11 11:25:00,,,,, +32,Review loan request,2023/06/11 11:40:00,2023/06/11 12:10:00,45000,36,home,, +32,Notify refusal,2023/06/11 12:25:00,2023/06/11 12:35:00,,,,no, +33,Request a loan,2023/06/11 13:00:00,2023/06/11 13:15:00,,,,, +33,Review loan request,2023/06/11 13:30:00,2023/06/11 14:00:00,200000,35,home,, +33,Notify refusal,2023/06/11 14:15:00,2023/06/11 14:25:00,,,,,no +34,Request a loan,2023/06/11 14:40:00,2023/06/11 14:55:00,,,,, +34,Review loan request,2023/06/11 15:10:00,2023/06/11 15:40:00,200000,35,home,, +34,Notify refusal,2023/06/11 15:55:00,2023/06/11 16:05:00,,,,,no +35,Request a loan,2023/06/11 16:20:00,2023/06/11 16:35:00,,,,, +35,Review loan request,2023/06/11 16:50:00,2023/06/11 17:20:00,75000,24,business,, +35,Write loan contract,2023/06/11 17:40:00,2023/06/11 18:10:00,,,,,yes +35,Sign contract,2023/06/11 18:30:00,2023/06/11 18:40:00,,,,, +35,Notify expiracy,2023/06/11 19:00:00,2023/06/11 19:10:00,,,,, +36,Request a loan,2023/06/11 19:30:00,2023/06/11 19:45:00,,,,, +36,Review loan request,2023/06/11 20:00:00,2023/06/11 20:30:00,,,,, +36,Notify refusal,2023/06/11 20:45:00,2023/06/11 20:55:00,100000,18,business,, +37,Request a loan,2023/06/11 21:10:00,2023/06/11 21:25:00,,,,,no +37,Review loan request,2023/06/11 21:40:00,2023/06/11 22:10:00,,,,, +37,Write loan contract,2023/06/11 22:30:00,2023/06/11 23:00:00,100000,18,business,, +37,Sign contract,2023/06/11 23:20,2023/06/11 23:30:00,,,,,no +37,Notify expiracy,2023/06/12 0:00:00,2023/06/12 0:10:00,,,,, +38,Request a loan,2023/06/12 0:40:00,2023/06/12 0:55:00,50000,48,home,, +38,Review loan request,2023/06/12 1:20:00,2023/06/12 1:50:00,,,,no, +38,Write loan contract,2023/06/12 2:10:00,2023/06/12 2:40:00,,,,, +38,Sign contract,2023/06/12 3:00:00,2023/06/12 3:10:00,50000,18,business,, +38,Notify expiracy,2023/06/12 3:40:00,2023/06/12 3:50:00,,,,,yes +39,Request a loan,2023/06/12 4:20:00,2023/06/12 4:35:00,,,,, +39,Review loan request,2023/06/12 5:00:00,2023/06/12 5:30:00,,,,, +39,Notify refusal,2023/06/12 5:50:00,2023/06/12 6:00:00,,,,, +40,Request a loan,2023/06/12 6:30:00,2023/06/12 6:45:00,5000,12,personal,, +40,Review loan request,2023/06/12 7:10:00,2023/06/12 7:40:00,,,,yes, +40,Write loan contract,2023/06/12 8:00:00,2023/06/12 8:30:00,,,,, +40,Sign contract,2023/06/12 8:50:00,2023/06/12 9:00:00,,,,, +40,Notify expiracy,2023/06/12 9:30:00,2023/06/12 9:40:00,,,,, +41,Request a loan,2023/06/11 23:40:00,2023/06/11 23:55:00,10000,120,home,, +41,Review loan request,2023/06/12 0:10:00,2023/06/12 0:40:00,,,,no, +41,Write loan contract,2023/06/12 1:00:00,2023/06/12 1:30:00,,,,, +41,Sign contract,2023/06/12 1:50:00,2023/06/12 2:00:00,50000,18,business,, +41,Validate contract,2023/06/12 2:20:00,2023/06/12 2:30:00,,,,,yes +41,Credit funds,2023/06/12 2:50:00,2023/06/12 3:00:00,,,,, +42,Request a loan,2023/06/12 3:20:00,2023/06/12 3:35:00,,,,, +42,Review loan request,2023/06/12 3:55:00,2023/06/12 4:25:00,,,,, +42,Notify refusal,2023/06/12 4:45:00,2023/06/12 4:55:00,,,,, +43,Request a loan,2023/06/12 5:15:00,2023/06/12 5:30:00,70000,40,business,, +43,Review loan request,2023/06/12 5:50:00,2023/06/12 6:20:00,,,,no, +43,Notify refusal,2023/06/12 6:40:00,2023/06/12 6:50:00,,,,, +44,Request a loan,2023/06/12 7:10:00,2023/06/12 7:25:00,70000,40,business,, +44,Validate loan request,2023/06/12 7:45:00,2023/06/12 8:15:00,,,,no, +44,Notify refusal,2023/06/12 8:35:00,2023/06/12 8:45:00,,,,, +45,Request a loan,2023/06/12 9:05:00,2023/06/12 9:20:00,75000,24,business,, +45,Review loan request,2023/06/12 9:40:00,2023/06/12 10:10:00,,,,,yes +45,Write loan contract,2023/06/12 10:30:00,2023/06/12 11:00:00,,,,, +45,Sign contract,2023/06/12 11:20:00,2023/06/12 11:30:00,,,,, +45,Notify expiracy,2023/06/12 11:50:00,2023/06/12 12:00:00,,,,, +46,Request a loan,2023/06/12 12:20:00,2023/06/12 12:35:00,5000,12,personal,, +46,Validate loan request,2023/06/12 12:55:00,2023/06/12 13:25:00,,,,yes, +46,Write loan contract,2023/06/12 13:45:00,2023/06/12 14:15:00,,,,, +46,Sign contract,2023/06/12 14:35:00,2023/06/12 14:45:00,,,,, +46,Notify expiracy,2023/06/12 15:05:00,2023/06/12 15:15:00,,,,, +47,Request a loan,2023/06/12 15:35:00,2023/06/12 15:50:00,50000,48,home,, +47,Validate loan request,2023/06/12 16:10:00,2023/06/12 16:40:00,,,,no, +47,Notify refusal,2023/06/12 17:00:00,2023/06/12 17:10:00,,,,, +48,Request a loan,2023/06/12 17:30:00,2023/06/12 17:45:00,50000,18,business,, +48,Review loan request,2023/06/12 18:05:00,2023/06/12 18:35:00,,,,,yes +48,Write loan contract,2023/06/12 18:55:00,2023/06/12 19:25:00,,,,, +48,Sign contract,2023/06/12 19:45:00,2023/06/12 19:55:00,,,,, +48,Validate contract,2023/06/12 20:15:00,2023/06/12 20:25:00,,,,, +48,Credit funds,2023/06/12 20:45:00,2023/06/12 20:55:00,,,,, +49,Request a loan,2023/06/12 21:15:00,2023/06/12 21:30:00,45000,36,home,, +49,Validate loan request,2023/06/12 21:50:00,2023/06/12 22:20:00,,,,no, +49,Notify refusal,2023/06/12 22:40:00,2023/06/12 22:50:00,,,,, \ No newline at end of file diff --git a/processmining-handson/process-mining-handson.Rmd b/processmining-handson/process-mining-handson.Rmd new file mode 100644 index 0000000..785fbb5 --- /dev/null +++ b/processmining-handson/process-mining-handson.Rmd @@ -0,0 +1,156 @@ +# Install libraries + +```{r} +install.packages("bupaverse") +install.packages("bpmnVisualizationR") +``` + +# Analyse du flux de contrĂ´le + +```{r} +# Compute frequency +library(bupaR) +library(dplyr) + +# Import the CSV process execution data and create a data frame +df <- read.csv("data/loan-app-process-data-simulated.csv") +print(df) +``` + +## Create bupaR activity log data structure + +```{r} +# Create bupaR activity log data structure +process_data <- df %>% + dplyr::rename(start = startTime, + complete = completeTime) %>% + convert_timestamps(columns = c("start", "complete"), format = ymd_hms) %>% + mutate(Actor = NA) %>% + activitylog(case_id = "loanID", + activity_id = "activity", + resource_id = "Actor", + timestamps = c("start", "complete")) + +print(process_data) +``` + +## Getting basic summary + +```{r} +# getting basic summary +process_data %>% n_activities +process_data %>% n_activity_instances +process_data %>% n_cases +``` + +## Explore executed process instances + +```{r} +process_data %>% trace_explorer(coverage = 1) +``` + +## Compute frequency + +```{r} +# get frequency of activities +process_data %>% activities +``` + +# Analyse de la Performance + +```{r} +process_data %>% processing_time("case", units = "hours")%>% + plot() +``` + +```{r} +process_data %>% + process_matrix(performance(FUN = mean, units = "hours", flow_time = "idle")) %>% + plot() +``` + +```{r} +library(psmineR) +process_data %>% + ps_detailed(segment_coverage = 0) %>% + plot() + +``` + +# Animate data + +```{r} +library(processanimateR) + +event_log <- to_eventlog(process_data) + +animate_process(event_log) + +animate_process(event_log, mapping = token_aes(color = token_scale("red"))) +``` + +# Prediction + +## Prepare the dataset + +```{r} +library("processpredictR") + +process_data_for_prediction <- prepare_examples(process_data, task = "outcome") + +print(process_data_for_prediction) +``` + +## Split into training/testing data + +```{r} +split <- process_data_for_prediction %>% split_train_test(split = 0.8) +split +``` + +## Create the predictive model + +```{r} +library(tensorflow) +library(keras) + +model <- split$train_df %>% create_model(name = "my_first_outcome_predictive_model") + +# the preprocessing steps, such as tokenizing of sequences, normalizing numerical features, etc. happen within the create_model() function and are abstracted from the user. +``` + +## Model Compilation & Training + +```{r} +model %>% compile() # model compilation +``` + +```{r} +hist <- fit(object = model, train_data = split$train_df, epochs = 5) +``` + +```{r} +hist$metrics +``` + +## Make predictions on the test data + +```{r} +predictions <- model %>% predict(test_data = split$test_df, + output = "append") # default +predictions %>% head(5) +``` + +```{r} +# print confusion matrix +confusion_matrix(predictions) +``` + +```{r} +model %>% evaluate(split$test_df) +``` + +```{r} +# library(reticulate) +# use_python("C:\\Users\\noura\\AppData\\Local\\Programs\\Python\\Python310") +```