import os

case_id_col = {}
activity_col = {}
resource_col = {}
timestamp_col = {}
label_col = {}
pos_label = {}
neg_label = {}
dynamic_cat_cols = {}
static_cat_cols = {}
dynamic_num_cols = {}
static_num_cols = {}
static_text_cols = {}
dynamic_text_cols = {}
filename = {}

logs_dir = "/gpfs/hpchome/etais/hpc_irheta/predictive-monitoring-benchmark/labeled_logs_csv_processed"

#### Traffic fines settings ####

for formula in range(1,3):
    dataset = "traffic_fines_%s"%formula
    
    filename[dataset] = os.path.join(logs_dir, "traffic_fines_%s.csv"%formula)
    
    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "Resource"
    timestamp_col[dataset] = "Complete Timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", "Resource", "lastSent", "notificationType", "dismissal"]
    static_cat_cols[dataset] = ["article", "vehicleClass"]
    dynamic_num_cols[dataset] = ["expense", "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour", "open_cases"]
    static_num_cols[dataset] = ["amount", "points"]
        

#### Sepsis Cases settings ####
datasets = ["sepsis_cases_%s" % i for i in range(1, 5)]

for dataset in datasets:
    
    filename[dataset] = os.path.join(logs_dir, "%s.csv" % dataset)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "org:group"
    timestamp_col[dataset] = "time:timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", 'org:group'] # i.e. event attributes
    static_cat_cols[dataset] = ['Diagnose', 'DiagnosticArtAstrup', 'DiagnosticBlood', 'DiagnosticECG',
                       'DiagnosticIC', 'DiagnosticLacticAcid', 'DiagnosticLiquor',
                       'DiagnosticOther', 'DiagnosticSputum', 'DiagnosticUrinaryCulture',
                       'DiagnosticUrinarySediment', 'DiagnosticXthorax', 'DisfuncOrg',
                       'Hypotensie', 'Hypoxie', 'InfectionSuspected', 'Infusion', 'Oligurie',
                       'SIRSCritHeartRate', 'SIRSCritLeucos', 'SIRSCritTachypnea',
                       'SIRSCritTemperature', 'SIRSCriteria2OrMore'] # i.e. case attributes that are known from the start
    dynamic_num_cols[dataset] = ['CRP', 'LacticAcid', 'Leucocytes', "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ['Age']
pos_label["sepsis_cases_4"] = "regular"
neg_label["sepsis_cases_4"] = "deviant"

#### Production log settings ####
dataset = "production"

filename[dataset] = os.path.join(logs_dir, "Production.csv")

case_id_col[dataset] = "Case ID"
activity_col[dataset] = "Activity"
resource_col[dataset] = "Resource"
timestamp_col[dataset] = "Complete Timestamp"
label_col[dataset] = "label"
neg_label[dataset] = "regular"
pos_label[dataset] = "deviant"

# features for classifier
static_cat_cols[dataset] = ["Part_Desc_", "Rework"]
static_num_cols[dataset] = ["Work_Order_Qty"]
dynamic_cat_cols[dataset] = ["Activity", "Resource", "Report_Type", "Resource.1"]
dynamic_num_cols[dataset] = ["Qty_Completed", "Qty_for_MRB", "activity_duration", "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]

#### BPIC2017 settings ####

bpic2017_dict = {"bpic2017_cancelled": "BPIC17_O_Cancelled.csv",
                 "bpic2017_accepted": "BPIC17_O_Accepted.csv",
                 "bpic2017_refused": "BPIC17_O_Refused.csv"
                }

for dataset, fname in bpic2017_dict.items():

    filename[dataset] = os.path.join(logs_dir, fname)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = 'org:resource'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = "label"
    neg_label[dataset] = "regular"
    pos_label[dataset] = "deviant"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", 'org:resource', 'Action', 'EventOrigin', 'lifecycle:transition',
                                "Accepted", "Selected"] 
    static_cat_cols[dataset] = ['ApplicationType', 'LoanGoal']
    dynamic_num_cols[dataset] = ['FirstWithdrawalAmount', 'MonthlyCost', 'NumberOfTerms', 'OfferedAmount', 'CreditScore',  "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour", "open_cases"]
    static_num_cols[dataset] = ['RequestedAmount']
    
    
#### Hospital billing settings ####
for i in range(1, 7):
    for suffix in ["", "_sample10000", "_sample30000"]:
        dataset = "hospital_billing_%s%s" % (i, suffix)

        filename[dataset] = os.path.join(logs_dir, "hospital_billing_%s%s.csv" % (i, suffix))

        case_id_col[dataset] = "Case ID"
        activity_col[dataset] = "Activity"
        resource_col[dataset] = "Resource"
        timestamp_col[dataset] = "Complete Timestamp"
        label_col[dataset] = "label"
        neg_label[dataset] = "regular"
        pos_label[dataset] = "deviant"

        if i == 1:
            neg_label[dataset] = "deviant"
            pos_label[dataset] = "regular"

        # features for classifier
        dynamic_cat_cols[dataset] = ["Activity", 'Resource', 'actOrange', 'actRed', 'blocked', 'caseType', 'diagnosis', 'flagC', 'flagD', 'msgCode', 'msgType', 'state', 'version']#, 'isCancelled', 'isClosed', 'closeCode'] 
        static_cat_cols[dataset] = ['speciality']
        dynamic_num_cols[dataset] = ['msgCount', "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour"]#, "open_cases"]
        static_num_cols[dataset] = []

        if i == 1: # label is created based on isCancelled attribute
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[dataset] if col != "isCancelled"]
        elif i == 2:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[dataset] if col != "isClosed"]
            
            
#### BPIC2012 settings ####
bpic2012_dict = {"bpic2012_cancelled": "bpic2012_O_CANCELLED-COMPLETE.csv",
                 "bpic2012_accepted": "bpic2012_O_ACCEPTED-COMPLETE.csv",
                 "bpic2012_declined": "bpic2012_O_DECLINED-COMPLETE.csv"
                }

for dataset, fname in bpic2012_dict.items():

    filename[dataset] = os.path.join(logs_dir, fname)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "Resource"
    timestamp_col[dataset] = "Complete Timestamp"
    label_col[dataset] = "label"
    neg_label[dataset] = "regular"
    pos_label[dataset] = "deviant"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", "Resource"]
    static_cat_cols[dataset] = []
    dynamic_num_cols[dataset] = ["hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ['AMOUNT_REQ']

    
#### BPIC2015 settings ####
for municipality in range(1,6):
    for formula in range(1,3):
        dataset = "bpic2015_%s_f%s"%(municipality, formula)
        
        filename[dataset] = os.path.join(logs_dir, "BPIC15_%s_f%s.csv"%(municipality, formula))

        case_id_col[dataset] = "Case ID"
        activity_col[dataset] = "Activity"
        resource_col[dataset] = "org:resource"
        timestamp_col[dataset] = "time:timestamp"
        label_col[dataset] = "label"
        pos_label[dataset] = "deviant"
        neg_label[dataset] = "regular"

        # features for classifier
        dynamic_cat_cols[dataset] = ["Activity", "monitoringResource", "question", "org:resource"]
        static_cat_cols[dataset] = ["Responsible_actor"]
        dynamic_num_cols[dataset] = ["hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
        static_num_cols[dataset] = ["SUMleges", 'Aanleg (Uitvoeren werk of werkzaamheid)', 'Bouw', 'Brandveilig gebruik (vergunning)', 'Gebiedsbescherming', 'Handelen in strijd met regels RO', 'Inrit/Uitweg', 'Kap', 'Milieu (neutraal wijziging)', 'Milieu (omgevingsvergunning beperkte milieutoets)', 'Milieu (vergunning)', 'Monument', 'Reclame', 'Sloop']
        
        if municipality in [3,5]:
            static_num_cols[dataset].append('Flora en Fauna')
        if municipality in [1,2,3,5]:
            static_num_cols[dataset].append('Brandveilig gebruik (melding)')
            static_num_cols[dataset].append('Milieu (melding)')
            
            
#### BPIC2011 settings ####
for formula in range(1,5):
    dataset = "bpic2011_f%s"%formula 
    
    filename[dataset] = os.path.join(logs_dir, "BPIC11_f%s.csv"%formula)
    
    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity code"
    resource_col[dataset] = "Producer code"
    timestamp_col[dataset] = "time:timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity code", "Producer code", "Section", "Specialism code.1", "group"]
    static_cat_cols[dataset] = ["Diagnosis", "Treatment code", "Diagnosis code", "Specialism code", "Diagnosis Treatment Combination ID"]
    dynamic_num_cols[dataset] = ["Number of executions", "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ["Age"]
    
    
#### Github settings ####
dataset = "github"

filename[dataset] = os.path.join(logs_dir, "github_data.csv")
case_id_col[dataset] = "issue_id"
label_col[dataset] = "closedin12"
dynamic_text_cols[dataset] = ['combined_text']#['comment_text']
static_text_cols[dataset] = []#['cleaned_text']
pos_label[dataset] = "1"
neg_label[dataset] = "0"
timestamp_col[dataset] = "created_at"
activity_col[dataset] = "issue_id"

# features for classifier
dynamic_num_cols[dataset] = ['comment_before_12month', 'actors', 
                             'commits_by_commiters_before3m', 'commits_by_commenters_nunique', 'ev_assigned', 'ev_labeled', 
                             'ev_mentioned', 'ev_referenced', 'ev_subscribed', 'created_before_project2w_sliding',
                             'closed_before_project2w_sliding', 'commit_before_project2w_sliding', 'comment_len_mean', 
                              'event_nr']
dynamic_cat_cols[dataset] = []
static_cat_cols[dataset] = []
static_num_cols[dataset] = ['lbl_bug', 'lbl_documentation', 'lbl_duplicate', 'lbl_enhancement', 'lbl_feature', 
                            'lbl_feature request', 'lbl_high priority', 'lbl_invalid', 'lbl_question', 'lbl_task', 
                            'lbl_wontfix', 'created_before3m', 'closed_before3m', 'commit_before3m', 'created_before_project3m', 
                             'closed_before_project3m', 'commit_before_project3m', 'body_len_strip']

b64709204217517cd46fb6e108759c9c0a06c4c5
<mask token>

<mask token>
for formula in range(1, 3):
    dataset = 'traffic_fines_%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'traffic_fines_%s.csv' % formula
        )
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'lastSent',
        'notificationType', 'dismissal']
    static_cat_cols[dataset] = ['article', 'vehicleClass']
    dynamic_num_cols[dataset] = ['expense', 'timesincelastevent',
        'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
        'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['amount', 'points']
<mask token>
for dataset in datasets:
    filename[dataset] = os.path.join(logs_dir, '%s.csv' % dataset)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:group'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'org:group']
    static_cat_cols[dataset] = ['Diagnose', 'DiagnosticArtAstrup',
        'DiagnosticBlood', 'DiagnosticECG', 'DiagnosticIC',
        'DiagnosticLacticAcid', 'DiagnosticLiquor', 'DiagnosticOther',
        'DiagnosticSputum', 'DiagnosticUrinaryCulture',
        'DiagnosticUrinarySediment', 'DiagnosticXthorax', 'DisfuncOrg',
        'Hypotensie', 'Hypoxie', 'InfectionSuspected', 'Infusion',
        'Oligurie', 'SIRSCritHeartRate', 'SIRSCritLeucos',
        'SIRSCritTachypnea', 'SIRSCritTemperature', 'SIRSCriteria2OrMore']
    dynamic_num_cols[dataset] = ['CRP', 'LacticAcid', 'Leucocytes', 'hour',
        'weekday', 'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
<mask token>
for dataset, fname in bpic2017_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:resource'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'org:resource', 'Action',
        'EventOrigin', 'lifecycle:transition', 'Accepted', 'Selected']
    static_cat_cols[dataset] = ['ApplicationType', 'LoanGoal']
    dynamic_num_cols[dataset] = ['FirstWithdrawalAmount', 'MonthlyCost',
        'NumberOfTerms', 'OfferedAmount', 'CreditScore',
        'timesincelastevent', 'timesincecasestart', 'timesincemidnight',
        'event_nr', 'month', 'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['RequestedAmount']
for i in range(1, 7):
    for suffix in ['', '_sample10000', '_sample30000']:
        dataset = 'hospital_billing_%s%s' % (i, suffix)
        filename[dataset] = os.path.join(logs_dir, 
            'hospital_billing_%s%s.csv' % (i, suffix))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'Resource'
        timestamp_col[dataset] = 'Complete Timestamp'
        label_col[dataset] = 'label'
        neg_label[dataset] = 'regular'
        pos_label[dataset] = 'deviant'
        if i == 1:
            neg_label[dataset] = 'deviant'
            pos_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'actOrange',
            'actRed', 'blocked', 'caseType', 'diagnosis', 'flagC', 'flagD',
            'msgCode', 'msgType', 'state', 'version']
        static_cat_cols[dataset] = ['speciality']
        dynamic_num_cols[dataset] = ['msgCount', 'timesincelastevent',
            'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
            'weekday', 'hour']
        static_num_cols[dataset] = []
        if i == 1:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isCancelled']
        elif i == 2:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isClosed']
<mask token>
for dataset, fname in bpic2012_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource']
    static_cat_cols[dataset] = []
    dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
        'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
        'event_nr', 'open_cases']
    static_num_cols[dataset] = ['AMOUNT_REQ']
for municipality in range(1, 6):
    for formula in range(1, 3):
        dataset = 'bpic2015_%s_f%s' % (municipality, formula)
        filename[dataset] = os.path.join(logs_dir, 'BPIC15_%s_f%s.csv' % (
            municipality, formula))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'org:resource'
        timestamp_col[dataset] = 'time:timestamp'
        label_col[dataset] = 'label'
        pos_label[dataset] = 'deviant'
        neg_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'monitoringResource',
            'question', 'org:resource']
        static_cat_cols[dataset] = ['Responsible_actor']
        dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
            'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
            'event_nr', 'open_cases']
        static_num_cols[dataset] = ['SUMleges',
            'Aanleg (Uitvoeren werk of werkzaamheid)', 'Bouw',
            'Brandveilig gebruik (vergunning)', 'Gebiedsbescherming',
            'Handelen in strijd met regels RO', 'Inrit/Uitweg', 'Kap',
            'Milieu (neutraal wijziging)',
            'Milieu (omgevingsvergunning beperkte milieutoets)',
            'Milieu (vergunning)', 'Monument', 'Reclame', 'Sloop']
        if municipality in [3, 5]:
            static_num_cols[dataset].append('Flora en Fauna')
        if municipality in [1, 2, 3, 5]:
            static_num_cols[dataset].append('Brandveilig gebruik (melding)')
            static_num_cols[dataset].append('Milieu (melding)')
for formula in range(1, 5):
    dataset = 'bpic2011_f%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'BPIC11_f%s.csv' % formula)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity code'
    resource_col[dataset] = 'Producer code'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity code', 'Producer code',
        'Section', 'Specialism code.1', 'group']
    static_cat_cols[dataset] = ['Diagnosis', 'Treatment code',
        'Diagnosis code', 'Specialism code',
        'Diagnosis Treatment Combination ID']
    dynamic_num_cols[dataset] = ['Number of executions', 'hour', 'weekday',
        'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
<mask token>

<mask token>
case_id_col = {}
activity_col = {}
resource_col = {}
timestamp_col = {}
label_col = {}
pos_label = {}
neg_label = {}
dynamic_cat_cols = {}
static_cat_cols = {}
dynamic_num_cols = {}
static_num_cols = {}
static_text_cols = {}
dynamic_text_cols = {}
filename = {}
logs_dir = (
    '/gpfs/hpchome/etais/hpc_irheta/predictive-monitoring-benchmark/labeled_logs_csv_processed'
    )
for formula in range(1, 3):
    dataset = 'traffic_fines_%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'traffic_fines_%s.csv' % formula
        )
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'lastSent',
        'notificationType', 'dismissal']
    static_cat_cols[dataset] = ['article', 'vehicleClass']
    dynamic_num_cols[dataset] = ['expense', 'timesincelastevent',
        'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
        'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['amount', 'points']
datasets = [('sepsis_cases_%s' % i) for i in range(1, 5)]
for dataset in datasets:
    filename[dataset] = os.path.join(logs_dir, '%s.csv' % dataset)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:group'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'org:group']
    static_cat_cols[dataset] = ['Diagnose', 'DiagnosticArtAstrup',
        'DiagnosticBlood', 'DiagnosticECG', 'DiagnosticIC',
        'DiagnosticLacticAcid', 'DiagnosticLiquor', 'DiagnosticOther',
        'DiagnosticSputum', 'DiagnosticUrinaryCulture',
        'DiagnosticUrinarySediment', 'DiagnosticXthorax', 'DisfuncOrg',
        'Hypotensie', 'Hypoxie', 'InfectionSuspected', 'Infusion',
        'Oligurie', 'SIRSCritHeartRate', 'SIRSCritLeucos',
        'SIRSCritTachypnea', 'SIRSCritTemperature', 'SIRSCriteria2OrMore']
    dynamic_num_cols[dataset] = ['CRP', 'LacticAcid', 'Leucocytes', 'hour',
        'weekday', 'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
pos_label['sepsis_cases_4'] = 'regular'
neg_label['sepsis_cases_4'] = 'deviant'
dataset = 'production'
filename[dataset] = os.path.join(logs_dir, 'Production.csv')
case_id_col[dataset] = 'Case ID'
activity_col[dataset] = 'Activity'
resource_col[dataset] = 'Resource'
timestamp_col[dataset] = 'Complete Timestamp'
label_col[dataset] = 'label'
neg_label[dataset] = 'regular'
pos_label[dataset] = 'deviant'
static_cat_cols[dataset] = ['Part_Desc_', 'Rework']
static_num_cols[dataset] = ['Work_Order_Qty']
dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'Report_Type',
    'Resource.1']
dynamic_num_cols[dataset] = ['Qty_Completed', 'Qty_for_MRB',
    'activity_duration', 'hour', 'weekday', 'month', 'timesincemidnight',
    'timesincelastevent', 'timesincecasestart', 'event_nr', 'open_cases']
bpic2017_dict = {'bpic2017_cancelled': 'BPIC17_O_Cancelled.csv',
    'bpic2017_accepted': 'BPIC17_O_Accepted.csv', 'bpic2017_refused':
    'BPIC17_O_Refused.csv'}
for dataset, fname in bpic2017_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:resource'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'org:resource', 'Action',
        'EventOrigin', 'lifecycle:transition', 'Accepted', 'Selected']
    static_cat_cols[dataset] = ['ApplicationType', 'LoanGoal']
    dynamic_num_cols[dataset] = ['FirstWithdrawalAmount', 'MonthlyCost',
        'NumberOfTerms', 'OfferedAmount', 'CreditScore',
        'timesincelastevent', 'timesincecasestart', 'timesincemidnight',
        'event_nr', 'month', 'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['RequestedAmount']
for i in range(1, 7):
    for suffix in ['', '_sample10000', '_sample30000']:
        dataset = 'hospital_billing_%s%s' % (i, suffix)
        filename[dataset] = os.path.join(logs_dir, 
            'hospital_billing_%s%s.csv' % (i, suffix))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'Resource'
        timestamp_col[dataset] = 'Complete Timestamp'
        label_col[dataset] = 'label'
        neg_label[dataset] = 'regular'
        pos_label[dataset] = 'deviant'
        if i == 1:
            neg_label[dataset] = 'deviant'
            pos_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'actOrange',
            'actRed', 'blocked', 'caseType', 'diagnosis', 'flagC', 'flagD',
            'msgCode', 'msgType', 'state', 'version']
        static_cat_cols[dataset] = ['speciality']
        dynamic_num_cols[dataset] = ['msgCount', 'timesincelastevent',
            'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
            'weekday', 'hour']
        static_num_cols[dataset] = []
        if i == 1:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isCancelled']
        elif i == 2:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isClosed']
bpic2012_dict = {'bpic2012_cancelled': 'bpic2012_O_CANCELLED-COMPLETE.csv',
    'bpic2012_accepted': 'bpic2012_O_ACCEPTED-COMPLETE.csv',
    'bpic2012_declined': 'bpic2012_O_DECLINED-COMPLETE.csv'}
for dataset, fname in bpic2012_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource']
    static_cat_cols[dataset] = []
    dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
        'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
        'event_nr', 'open_cases']
    static_num_cols[dataset] = ['AMOUNT_REQ']
for municipality in range(1, 6):
    for formula in range(1, 3):
        dataset = 'bpic2015_%s_f%s' % (municipality, formula)
        filename[dataset] = os.path.join(logs_dir, 'BPIC15_%s_f%s.csv' % (
            municipality, formula))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'org:resource'
        timestamp_col[dataset] = 'time:timestamp'
        label_col[dataset] = 'label'
        pos_label[dataset] = 'deviant'
        neg_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'monitoringResource',
            'question', 'org:resource']
        static_cat_cols[dataset] = ['Responsible_actor']
        dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
            'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
            'event_nr', 'open_cases']
        static_num_cols[dataset] = ['SUMleges',
            'Aanleg (Uitvoeren werk of werkzaamheid)', 'Bouw',
            'Brandveilig gebruik (vergunning)', 'Gebiedsbescherming',
            'Handelen in strijd met regels RO', 'Inrit/Uitweg', 'Kap',
            'Milieu (neutraal wijziging)',
            'Milieu (omgevingsvergunning beperkte milieutoets)',
            'Milieu (vergunning)', 'Monument', 'Reclame', 'Sloop']
        if municipality in [3, 5]:
            static_num_cols[dataset].append('Flora en Fauna')
        if municipality in [1, 2, 3, 5]:
            static_num_cols[dataset].append('Brandveilig gebruik (melding)')
            static_num_cols[dataset].append('Milieu (melding)')
for formula in range(1, 5):
    dataset = 'bpic2011_f%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'BPIC11_f%s.csv' % formula)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity code'
    resource_col[dataset] = 'Producer code'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity code', 'Producer code',
        'Section', 'Specialism code.1', 'group']
    static_cat_cols[dataset] = ['Diagnosis', 'Treatment code',
        'Diagnosis code', 'Specialism code',
        'Diagnosis Treatment Combination ID']
    dynamic_num_cols[dataset] = ['Number of executions', 'hour', 'weekday',
        'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
dataset = 'github'
filename[dataset] = os.path.join(logs_dir, 'github_data.csv')
case_id_col[dataset] = 'issue_id'
label_col[dataset] = 'closedin12'
dynamic_text_cols[dataset] = ['combined_text']
static_text_cols[dataset] = []
pos_label[dataset] = '1'
neg_label[dataset] = '0'
timestamp_col[dataset] = 'created_at'
activity_col[dataset] = 'issue_id'
dynamic_num_cols[dataset] = ['comment_before_12month', 'actors',
    'commits_by_commiters_before3m', 'commits_by_commenters_nunique',
    'ev_assigned', 'ev_labeled', 'ev_mentioned', 'ev_referenced',
    'ev_subscribed', 'created_before_project2w_sliding',
    'closed_before_project2w_sliding', 'commit_before_project2w_sliding',
    'comment_len_mean', 'event_nr']
dynamic_cat_cols[dataset] = []
static_cat_cols[dataset] = []
static_num_cols[dataset] = ['lbl_bug', 'lbl_documentation', 'lbl_duplicate',
    'lbl_enhancement', 'lbl_feature', 'lbl_feature request',
    'lbl_high priority', 'lbl_invalid', 'lbl_question', 'lbl_task',
    'lbl_wontfix', 'created_before3m', 'closed_before3m', 'commit_before3m',
    'created_before_project3m', 'closed_before_project3m',
    'commit_before_project3m', 'body_len_strip']

import os
case_id_col = {}
activity_col = {}
resource_col = {}
timestamp_col = {}
label_col = {}
pos_label = {}
neg_label = {}
dynamic_cat_cols = {}
static_cat_cols = {}
dynamic_num_cols = {}
static_num_cols = {}
static_text_cols = {}
dynamic_text_cols = {}
filename = {}
logs_dir = (
    '/gpfs/hpchome/etais/hpc_irheta/predictive-monitoring-benchmark/labeled_logs_csv_processed'
    )
for formula in range(1, 3):
    dataset = 'traffic_fines_%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'traffic_fines_%s.csv' % formula
        )
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'lastSent',
        'notificationType', 'dismissal']
    static_cat_cols[dataset] = ['article', 'vehicleClass']
    dynamic_num_cols[dataset] = ['expense', 'timesincelastevent',
        'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
        'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['amount', 'points']
datasets = [('sepsis_cases_%s' % i) for i in range(1, 5)]
for dataset in datasets:
    filename[dataset] = os.path.join(logs_dir, '%s.csv' % dataset)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:group'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity', 'org:group']
    static_cat_cols[dataset] = ['Diagnose', 'DiagnosticArtAstrup',
        'DiagnosticBlood', 'DiagnosticECG', 'DiagnosticIC',
        'DiagnosticLacticAcid', 'DiagnosticLiquor', 'DiagnosticOther',
        'DiagnosticSputum', 'DiagnosticUrinaryCulture',
        'DiagnosticUrinarySediment', 'DiagnosticXthorax', 'DisfuncOrg',
        'Hypotensie', 'Hypoxie', 'InfectionSuspected', 'Infusion',
        'Oligurie', 'SIRSCritHeartRate', 'SIRSCritLeucos',
        'SIRSCritTachypnea', 'SIRSCritTemperature', 'SIRSCriteria2OrMore']
    dynamic_num_cols[dataset] = ['CRP', 'LacticAcid', 'Leucocytes', 'hour',
        'weekday', 'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
pos_label['sepsis_cases_4'] = 'regular'
neg_label['sepsis_cases_4'] = 'deviant'
dataset = 'production'
filename[dataset] = os.path.join(logs_dir, 'Production.csv')
case_id_col[dataset] = 'Case ID'
activity_col[dataset] = 'Activity'
resource_col[dataset] = 'Resource'
timestamp_col[dataset] = 'Complete Timestamp'
label_col[dataset] = 'label'
neg_label[dataset] = 'regular'
pos_label[dataset] = 'deviant'
static_cat_cols[dataset] = ['Part_Desc_', 'Rework']
static_num_cols[dataset] = ['Work_Order_Qty']
dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'Report_Type',
    'Resource.1']
dynamic_num_cols[dataset] = ['Qty_Completed', 'Qty_for_MRB',
    'activity_duration', 'hour', 'weekday', 'month', 'timesincemidnight',
    'timesincelastevent', 'timesincecasestart', 'event_nr', 'open_cases']
bpic2017_dict = {'bpic2017_cancelled': 'BPIC17_O_Cancelled.csv',
    'bpic2017_accepted': 'BPIC17_O_Accepted.csv', 'bpic2017_refused':
    'BPIC17_O_Refused.csv'}
for dataset, fname in bpic2017_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'org:resource'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'org:resource', 'Action',
        'EventOrigin', 'lifecycle:transition', 'Accepted', 'Selected']
    static_cat_cols[dataset] = ['ApplicationType', 'LoanGoal']
    dynamic_num_cols[dataset] = ['FirstWithdrawalAmount', 'MonthlyCost',
        'NumberOfTerms', 'OfferedAmount', 'CreditScore',
        'timesincelastevent', 'timesincecasestart', 'timesincemidnight',
        'event_nr', 'month', 'weekday', 'hour', 'open_cases']
    static_num_cols[dataset] = ['RequestedAmount']
for i in range(1, 7):
    for suffix in ['', '_sample10000', '_sample30000']:
        dataset = 'hospital_billing_%s%s' % (i, suffix)
        filename[dataset] = os.path.join(logs_dir, 
            'hospital_billing_%s%s.csv' % (i, suffix))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'Resource'
        timestamp_col[dataset] = 'Complete Timestamp'
        label_col[dataset] = 'label'
        neg_label[dataset] = 'regular'
        pos_label[dataset] = 'deviant'
        if i == 1:
            neg_label[dataset] = 'deviant'
            pos_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'Resource', 'actOrange',
            'actRed', 'blocked', 'caseType', 'diagnosis', 'flagC', 'flagD',
            'msgCode', 'msgType', 'state', 'version']
        static_cat_cols[dataset] = ['speciality']
        dynamic_num_cols[dataset] = ['msgCount', 'timesincelastevent',
            'timesincecasestart', 'timesincemidnight', 'event_nr', 'month',
            'weekday', 'hour']
        static_num_cols[dataset] = []
        if i == 1:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isCancelled']
        elif i == 2:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[
                dataset] if col != 'isClosed']
bpic2012_dict = {'bpic2012_cancelled': 'bpic2012_O_CANCELLED-COMPLETE.csv',
    'bpic2012_accepted': 'bpic2012_O_ACCEPTED-COMPLETE.csv',
    'bpic2012_declined': 'bpic2012_O_DECLINED-COMPLETE.csv'}
for dataset, fname in bpic2012_dict.items():
    filename[dataset] = os.path.join(logs_dir, fname)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity'
    resource_col[dataset] = 'Resource'
    timestamp_col[dataset] = 'Complete Timestamp'
    label_col[dataset] = 'label'
    neg_label[dataset] = 'regular'
    pos_label[dataset] = 'deviant'
    dynamic_cat_cols[dataset] = ['Activity', 'Resource']
    static_cat_cols[dataset] = []
    dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
        'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
        'event_nr', 'open_cases']
    static_num_cols[dataset] = ['AMOUNT_REQ']
for municipality in range(1, 6):
    for formula in range(1, 3):
        dataset = 'bpic2015_%s_f%s' % (municipality, formula)
        filename[dataset] = os.path.join(logs_dir, 'BPIC15_%s_f%s.csv' % (
            municipality, formula))
        case_id_col[dataset] = 'Case ID'
        activity_col[dataset] = 'Activity'
        resource_col[dataset] = 'org:resource'
        timestamp_col[dataset] = 'time:timestamp'
        label_col[dataset] = 'label'
        pos_label[dataset] = 'deviant'
        neg_label[dataset] = 'regular'
        dynamic_cat_cols[dataset] = ['Activity', 'monitoringResource',
            'question', 'org:resource']
        static_cat_cols[dataset] = ['Responsible_actor']
        dynamic_num_cols[dataset] = ['hour', 'weekday', 'month',
            'timesincemidnight', 'timesincelastevent', 'timesincecasestart',
            'event_nr', 'open_cases']
        static_num_cols[dataset] = ['SUMleges',
            'Aanleg (Uitvoeren werk of werkzaamheid)', 'Bouw',
            'Brandveilig gebruik (vergunning)', 'Gebiedsbescherming',
            'Handelen in strijd met regels RO', 'Inrit/Uitweg', 'Kap',
            'Milieu (neutraal wijziging)',
            'Milieu (omgevingsvergunning beperkte milieutoets)',
            'Milieu (vergunning)', 'Monument', 'Reclame', 'Sloop']
        if municipality in [3, 5]:
            static_num_cols[dataset].append('Flora en Fauna')
        if municipality in [1, 2, 3, 5]:
            static_num_cols[dataset].append('Brandveilig gebruik (melding)')
            static_num_cols[dataset].append('Milieu (melding)')
for formula in range(1, 5):
    dataset = 'bpic2011_f%s' % formula
    filename[dataset] = os.path.join(logs_dir, 'BPIC11_f%s.csv' % formula)
    case_id_col[dataset] = 'Case ID'
    activity_col[dataset] = 'Activity code'
    resource_col[dataset] = 'Producer code'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = 'label'
    pos_label[dataset] = 'deviant'
    neg_label[dataset] = 'regular'
    dynamic_cat_cols[dataset] = ['Activity code', 'Producer code',
        'Section', 'Specialism code.1', 'group']
    static_cat_cols[dataset] = ['Diagnosis', 'Treatment code',
        'Diagnosis code', 'Specialism code',
        'Diagnosis Treatment Combination ID']
    dynamic_num_cols[dataset] = ['Number of executions', 'hour', 'weekday',
        'month', 'timesincemidnight', 'timesincelastevent',
        'timesincecasestart', 'event_nr', 'open_cases']
    static_num_cols[dataset] = ['Age']
dataset = 'github'
filename[dataset] = os.path.join(logs_dir, 'github_data.csv')
case_id_col[dataset] = 'issue_id'
label_col[dataset] = 'closedin12'
dynamic_text_cols[dataset] = ['combined_text']
static_text_cols[dataset] = []
pos_label[dataset] = '1'
neg_label[dataset] = '0'
timestamp_col[dataset] = 'created_at'
activity_col[dataset] = 'issue_id'
dynamic_num_cols[dataset] = ['comment_before_12month', 'actors',
    'commits_by_commiters_before3m', 'commits_by_commenters_nunique',
    'ev_assigned', 'ev_labeled', 'ev_mentioned', 'ev_referenced',
    'ev_subscribed', 'created_before_project2w_sliding',
    'closed_before_project2w_sliding', 'commit_before_project2w_sliding',
    'comment_len_mean', 'event_nr']
dynamic_cat_cols[dataset] = []
static_cat_cols[dataset] = []
static_num_cols[dataset] = ['lbl_bug', 'lbl_documentation', 'lbl_duplicate',
    'lbl_enhancement', 'lbl_feature', 'lbl_feature request',
    'lbl_high priority', 'lbl_invalid', 'lbl_question', 'lbl_task',
    'lbl_wontfix', 'created_before3m', 'closed_before3m', 'commit_before3m',
    'created_before_project3m', 'closed_before_project3m',
    'commit_before_project3m', 'body_len_strip']

import os

case_id_col = {}
activity_col = {}
resource_col = {}
timestamp_col = {}
label_col = {}
pos_label = {}
neg_label = {}
dynamic_cat_cols = {}
static_cat_cols = {}
dynamic_num_cols = {}
static_num_cols = {}
static_text_cols = {}
dynamic_text_cols = {}
filename = {}

logs_dir = "/gpfs/hpchome/etais/hpc_irheta/predictive-monitoring-benchmark/labeled_logs_csv_processed"

#### Traffic fines settings ####

for formula in range(1,3):
    dataset = "traffic_fines_%s"%formula
    
    filename[dataset] = os.path.join(logs_dir, "traffic_fines_%s.csv"%formula)
    
    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "Resource"
    timestamp_col[dataset] = "Complete Timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", "Resource", "lastSent", "notificationType", "dismissal"]
    static_cat_cols[dataset] = ["article", "vehicleClass"]
    dynamic_num_cols[dataset] = ["expense", "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour", "open_cases"]
    static_num_cols[dataset] = ["amount", "points"]
        

#### Sepsis Cases settings ####
datasets = ["sepsis_cases_%s" % i for i in range(1, 5)]

for dataset in datasets:
    
    filename[dataset] = os.path.join(logs_dir, "%s.csv" % dataset)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "org:group"
    timestamp_col[dataset] = "time:timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", 'org:group'] # i.e. event attributes
    static_cat_cols[dataset] = ['Diagnose', 'DiagnosticArtAstrup', 'DiagnosticBlood', 'DiagnosticECG',
                       'DiagnosticIC', 'DiagnosticLacticAcid', 'DiagnosticLiquor',
                       'DiagnosticOther', 'DiagnosticSputum', 'DiagnosticUrinaryCulture',
                       'DiagnosticUrinarySediment', 'DiagnosticXthorax', 'DisfuncOrg',
                       'Hypotensie', 'Hypoxie', 'InfectionSuspected', 'Infusion', 'Oligurie',
                       'SIRSCritHeartRate', 'SIRSCritLeucos', 'SIRSCritTachypnea',
                       'SIRSCritTemperature', 'SIRSCriteria2OrMore'] # i.e. case attributes that are known from the start
    dynamic_num_cols[dataset] = ['CRP', 'LacticAcid', 'Leucocytes', "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ['Age']
pos_label["sepsis_cases_4"] = "regular"
neg_label["sepsis_cases_4"] = "deviant"

#### Production log settings ####
dataset = "production"

filename[dataset] = os.path.join(logs_dir, "Production.csv")

case_id_col[dataset] = "Case ID"
activity_col[dataset] = "Activity"
resource_col[dataset] = "Resource"
timestamp_col[dataset] = "Complete Timestamp"
label_col[dataset] = "label"
neg_label[dataset] = "regular"
pos_label[dataset] = "deviant"

# features for classifier
static_cat_cols[dataset] = ["Part_Desc_", "Rework"]
static_num_cols[dataset] = ["Work_Order_Qty"]
dynamic_cat_cols[dataset] = ["Activity", "Resource", "Report_Type", "Resource.1"]
dynamic_num_cols[dataset] = ["Qty_Completed", "Qty_for_MRB", "activity_duration", "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]

#### BPIC2017 settings ####

bpic2017_dict = {"bpic2017_cancelled": "BPIC17_O_Cancelled.csv",
                 "bpic2017_accepted": "BPIC17_O_Accepted.csv",
                 "bpic2017_refused": "BPIC17_O_Refused.csv"
                }

for dataset, fname in bpic2017_dict.items():

    filename[dataset] = os.path.join(logs_dir, fname)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = 'org:resource'
    timestamp_col[dataset] = 'time:timestamp'
    label_col[dataset] = "label"
    neg_label[dataset] = "regular"
    pos_label[dataset] = "deviant"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", 'org:resource', 'Action', 'EventOrigin', 'lifecycle:transition',
                                "Accepted", "Selected"] 
    static_cat_cols[dataset] = ['ApplicationType', 'LoanGoal']
    dynamic_num_cols[dataset] = ['FirstWithdrawalAmount', 'MonthlyCost', 'NumberOfTerms', 'OfferedAmount', 'CreditScore',  "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour", "open_cases"]
    static_num_cols[dataset] = ['RequestedAmount']
    
    
#### Hospital billing settings ####
for i in range(1, 7):
    for suffix in ["", "_sample10000", "_sample30000"]:
        dataset = "hospital_billing_%s%s" % (i, suffix)

        filename[dataset] = os.path.join(logs_dir, "hospital_billing_%s%s.csv" % (i, suffix))

        case_id_col[dataset] = "Case ID"
        activity_col[dataset] = "Activity"
        resource_col[dataset] = "Resource"
        timestamp_col[dataset] = "Complete Timestamp"
        label_col[dataset] = "label"
        neg_label[dataset] = "regular"
        pos_label[dataset] = "deviant"

        if i == 1:
            neg_label[dataset] = "deviant"
            pos_label[dataset] = "regular"

        # features for classifier
        dynamic_cat_cols[dataset] = ["Activity", 'Resource', 'actOrange', 'actRed', 'blocked', 'caseType', 'diagnosis', 'flagC', 'flagD', 'msgCode', 'msgType', 'state', 'version']#, 'isCancelled', 'isClosed', 'closeCode'] 
        static_cat_cols[dataset] = ['speciality']
        dynamic_num_cols[dataset] = ['msgCount', "timesincelastevent", "timesincecasestart", "timesincemidnight", "event_nr", "month", "weekday", "hour"]#, "open_cases"]
        static_num_cols[dataset] = []

        if i == 1: # label is created based on isCancelled attribute
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[dataset] if col != "isCancelled"]
        elif i == 2:
            dynamic_cat_cols[dataset] = [col for col in dynamic_cat_cols[dataset] if col != "isClosed"]
            
            
#### BPIC2012 settings ####
bpic2012_dict = {"bpic2012_cancelled": "bpic2012_O_CANCELLED-COMPLETE.csv",
                 "bpic2012_accepted": "bpic2012_O_ACCEPTED-COMPLETE.csv",
                 "bpic2012_declined": "bpic2012_O_DECLINED-COMPLETE.csv"
                }

for dataset, fname in bpic2012_dict.items():

    filename[dataset] = os.path.join(logs_dir, fname)

    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity"
    resource_col[dataset] = "Resource"
    timestamp_col[dataset] = "Complete Timestamp"
    label_col[dataset] = "label"
    neg_label[dataset] = "regular"
    pos_label[dataset] = "deviant"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity", "Resource"]
    static_cat_cols[dataset] = []
    dynamic_num_cols[dataset] = ["hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ['AMOUNT_REQ']

    
#### BPIC2015 settings ####
for municipality in range(1,6):
    for formula in range(1,3):
        dataset = "bpic2015_%s_f%s"%(municipality, formula)
        
        filename[dataset] = os.path.join(logs_dir, "BPIC15_%s_f%s.csv"%(municipality, formula))

        case_id_col[dataset] = "Case ID"
        activity_col[dataset] = "Activity"
        resource_col[dataset] = "org:resource"
        timestamp_col[dataset] = "time:timestamp"
        label_col[dataset] = "label"
        pos_label[dataset] = "deviant"
        neg_label[dataset] = "regular"

        # features for classifier
        dynamic_cat_cols[dataset] = ["Activity", "monitoringResource", "question", "org:resource"]
        static_cat_cols[dataset] = ["Responsible_actor"]
        dynamic_num_cols[dataset] = ["hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
        static_num_cols[dataset] = ["SUMleges", 'Aanleg (Uitvoeren werk of werkzaamheid)', 'Bouw', 'Brandveilig gebruik (vergunning)', 'Gebiedsbescherming', 'Handelen in strijd met regels RO', 'Inrit/Uitweg', 'Kap', 'Milieu (neutraal wijziging)', 'Milieu (omgevingsvergunning beperkte milieutoets)', 'Milieu (vergunning)', 'Monument', 'Reclame', 'Sloop']
        
        if municipality in [3,5]:
            static_num_cols[dataset].append('Flora en Fauna')
        if municipality in [1,2,3,5]:
            static_num_cols[dataset].append('Brandveilig gebruik (melding)')
            static_num_cols[dataset].append('Milieu (melding)')
            
            
#### BPIC2011 settings ####
for formula in range(1,5):
    dataset = "bpic2011_f%s"%formula 
    
    filename[dataset] = os.path.join(logs_dir, "BPIC11_f%s.csv"%formula)
    
    case_id_col[dataset] = "Case ID"
    activity_col[dataset] = "Activity code"
    resource_col[dataset] = "Producer code"
    timestamp_col[dataset] = "time:timestamp"
    label_col[dataset] = "label"
    pos_label[dataset] = "deviant"
    neg_label[dataset] = "regular"

    # features for classifier
    dynamic_cat_cols[dataset] = ["Activity code", "Producer code", "Section", "Specialism code.1", "group"]
    static_cat_cols[dataset] = ["Diagnosis", "Treatment code", "Diagnosis code", "Specialism code", "Diagnosis Treatment Combination ID"]
    dynamic_num_cols[dataset] = ["Number of executions", "hour", "weekday", "month", "timesincemidnight", "timesincelastevent", "timesincecasestart", "event_nr", "open_cases"]
    static_num_cols[dataset] = ["Age"]
    
    
#### Github settings ####
dataset = "github"

filename[dataset] = os.path.join(logs_dir, "github_data.csv")
case_id_col[dataset] = "issue_id"
label_col[dataset] = "closedin12"
dynamic_text_cols[dataset] = ['combined_text']#['comment_text']
static_text_cols[dataset] = []#['cleaned_text']
pos_label[dataset] = "1"
neg_label[dataset] = "0"
timestamp_col[dataset] = "created_at"
activity_col[dataset] = "issue_id"

# features for classifier
dynamic_num_cols[dataset] = ['comment_before_12month', 'actors', 
                             'commits_by_commiters_before3m', 'commits_by_commenters_nunique', 'ev_assigned', 'ev_labeled', 
                             'ev_mentioned', 'ev_referenced', 'ev_subscribed', 'created_before_project2w_sliding',
                             'closed_before_project2w_sliding', 'commit_before_project2w_sliding', 'comment_len_mean', 
                              'event_nr']
dynamic_cat_cols[dataset] = []
static_cat_cols[dataset] = []
static_num_cols[dataset] = ['lbl_bug', 'lbl_documentation', 'lbl_duplicate', 'lbl_enhancement', 'lbl_feature', 
                            'lbl_feature request', 'lbl_high priority', 'lbl_invalid', 'lbl_question', 'lbl_task', 
                            'lbl_wontfix', 'created_before3m', 'closed_before3m', 'commit_before3m', 'created_before_project3m', 
                             'closed_before_project3m', 'commit_before_project3m', 'body_len_strip']
