Example #1
0
 def get_im_tree_from_variants(self, parameters=None):
     variants = {
         x["variant"]: x["count"]
         for x in self.get_variants(parameters=parameters)["variants"]
     }
     tree = inductive_miner.apply_tree_variants(variants,
                                                parameters=parameters)
     return tree
Example #2
0
    def get_im_tree_from_variants(self, parameters=None):
        if parameters is None:
            parameters = {}

        parameters["window_size"] = 1000000000000
        variants = {x["variant"]: x["count"] for x in self.get_variants(parameters=parameters)["variants"]}
        tree = inductive_miner.apply_tree_variants(variants, parameters=parameters)
        return tree
Example #3
0
 def test_df_tree_variants_dfg_based(self):
     df = pd.read_csv(os.path.join("input_data", "running-example.csv"))
     df = dataframe_utils.convert_timestamp_columns_in_df(df)
     tree = inductive_miner.apply_tree_variants(
         pd_variants.get_variants_set(df),
         variant=inductive_miner.DFG_BASED)
Example #4
0
 def test_log_tree_variants_dfg_based(self):
     log = xes_importer.apply(
         os.path.join("input_data", "running-example.xes"))
     tree = inductive_miner.apply_tree_variants(
         log_variants.get_variants(log), variant=inductive_miner.DFG_BASED)
Example #5
0
         log, parameters={"pm4py:param:activity_key": CLASSIFIER})
 elif "parquet" in log_name:
     from pm4py.statistics.attributes.pandas import get as attributes_get_pandas
     dataframe = pd.read_parquet(log_path)
     activities = set(
         attributes_get_pandas.get_attribute_values(
             dataframe, CLASSIFIER).keys())
     variants = pm4py.get_variants(dataframe)
     fp_log = pm4py.algo.discovery.footprints.log.variants.entire_dataframe.apply(
         dataframe)
 print("start tree_im_clean")
 tree_im_clean = im_clean.apply_tree(
     log, parameters={"pm4py:param:activity_key": CLASSIFIER})
 print("end tree_im_clean")
 tree_im = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IM,
     parameters={"pm4py:param:activity_key": CLASSIFIER})
 print(tree_im_clean)
 print(tree_im)
 tree_imf = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IMf,
     parameters={"pm4py:param:activity_key": CLASSIFIER})
 tree_imd = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IMd,
     parameters={"pm4py:param:activity_key": CLASSIFIER})
 fp_tree_clean = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
     tree_im_clean)
 fp_tree_im = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
     tree_im)
Example #6
0
             dataframe, CLASSIFIER).keys())
     variants = pm4py.get_variants_as_tuples(dataframe)
     variants = {",".join(x): y for x, y in variants.items()}
     fp_log = pm4py.algo.discovery.footprints.log.variants.entire_dataframe.apply(
         dataframe)
 print("start tree_im_clean")
 tree_im_clean = im_clean.apply_tree(log,
                                     parameters={
                                         "pm4py:param:activity_key":
                                         CLASSIFIER,
                                         "noise_threshold":
                                         NOISE_THRESHOLD
                                     })
 print("end tree_im_clean")
 tree_im = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IM,
     parameters={"pm4py:param:activity_key": CLASSIFIER})
 print(tree_im_clean)
 print(tree_im)
 tree_imf = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IMf,
     parameters={
         "pm4py:param:activity_key": CLASSIFIER,
         "noiseThreshold": NOISE_THRESHOLD
     })
 tree_imd = inductive_miner.apply_tree_variants(
     variants,
     variant=inductive_miner.Variants.IMd,
     parameters={"pm4py:param:activity_key": CLASSIFIER})
 fp_tree_clean = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
for log_name in os.listdir(LOGS_FOLDER):
    if "xes" in log_name or "parquet" in log_name:
        log_path = os.path.join(LOGS_FOLDER, log_name)
        print("")
        print(log_path)
        if "xes" in log_name:
            log = pm4py.read_xes(log_path)
            variants = pm4py.get_variants(log)
            fp_log = pm4py.algo.discovery.footprints.log.variants.entire_event_log.apply(
                log)
        elif "parquet" in log_name:
            dataframe = pd.read_parquet(log_path)
            variants = pm4py.get_variants(dataframe)
            fp_log = pm4py.algo.discovery.footprints.log.variants.entire_dataframe.apply(
                dataframe)
        tree_im = inductive_miner.apply_tree_variants(
            variants, variant=inductive_miner.Variants.IM)
        tree_imf = inductive_miner.apply_tree_variants(
            variants, variant=inductive_miner.Variants.IMf)
        tree_imd = inductive_miner.apply_tree_variants(
            variants, variant=inductive_miner.Variants.IMd)
        fp_tree_im = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
            tree_im)
        fp_tree_imf = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
            tree_imf)
        fp_tree_imd = pm4py.algo.discovery.footprints.tree.variants.bottomup.apply(
            tree_imd)
        fp_conf_im = pm4py.algo.conformance.footprints.variants.log_extensive.apply(
            fp_log, fp_tree_im)
        fp_conf_imf = pm4py.algo.conformance.footprints.variants.log_extensive.apply(
            fp_log, fp_tree_imf)
        fp_conf_imd = pm4py.algo.conformance.footprints.variants.log_extensive.apply(