Exemple #1
0
 def test_pdimp_xesexp(self):
     log0 = csv_import_adapter.import_dataframe_from_path(
         os.path.join("input_data", "running-example.csv"))
     log = log_conv_factory.apply(log0,
                                  variant=log_conv_factory.TO_EVENT_LOG)
     stream = log_conv_factory.apply(
         log0, variant=log_conv_factory.TO_EVENT_STREAM)
     df = log_conv_factory.apply(log0,
                                 variant=log_conv_factory.TO_DATAFRAME)
     xes_exporter_factory.apply(log, "ru.xes")
     xes_exporter_factory.apply(stream, "ru.xes")
     xes_exporter_factory.apply(df, "ru.xes")
     os.remove('ru.xes')
Exemple #2
0
from pm4py.algo.discovery.transition_system import factory as trans_factory
from pm4py.objects.log.importer.xes import factory as xes_importer
import os
from translucent_event_log.algo.discover_petrinet import state_based_region as sb
from pm4py.visualization.petrinet import factory as vis_factory

from translucent_event_log.objects.tel.importer.xes import utils as xes_utils
from translucent_event_log.objects.tel.importer.xes import iterparse_tel
from translucent_event_log.objects.tel.utils import tel_set_enabled
from pm4py.objects.log.exporter.xes import factory as xes_exporter

os.chdir('C:\\Users\\yunhui\\PycharmProjects\\tel_web')


def xes_import(input_file_path):
    #make xes file into tel object
    tel = iterparse_tel.import_tel(input_file_path)
    xes_utils.set_enabled(tel)
    return tel


tel = xes_import(os.path.join("input_data", "roadtraffic100traces.xes"))
xes_exporter.apply(tel, "road100_tel.xes")
Exemple #3
0
        datetime(2018,
                 4,
                 10,
                 0,
                 0,
                 tzinfo=timezone(timedelta(seconds=3600 * 2))),
        datetime(2018,
                 4,
                 13,
                 0,
                 0,
                 tzinfo=timezone(timedelta(seconds=3600 * 2)))
    ]
}
log = util.filter_abnormal_cases(log_origin, selection)
# print(len(log))
util.decode_event_concept(log)
#
# """
# Rename event concept name for analysis
# """
util.convert_event_attr_to_concept(log, ['stage', 'action'])
xes_exporter.apply(
    log, analysis_path + file_names[idx_dataset] + '_stageAction.xes')
#
#
#
# from pm4py.objects.log.util import sampling
# sampled_log = sampling.sample(log_origin, n=50)
# csv_exporter.apply(sampled_log, analAysis_path+file_names[1]+'.csv')