pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

There is a bug in the connection of heu_net for heuristic miner ++ #356

Closed JackEnzo closed 1 year ago

JackEnzo commented 1 year ago
from pm4py.algo.discovery.heuristics.variants import plusplus
from pm4py.visualization.heuristics_net import visualizer
from pm4py.visualization.petri_net import visualizer as pn_visualizer
import pandas as pd

def execute_script():
    df = pd.read_csv("../tests/input_data/interval_event_log.csv")
    df = pm4py.format_dataframe(df)
    heu_net_2 = plusplus.apply_heu_pandas(df, parameters={"heu_net_decoration": "frequency",  "min_dfg_occurrences": 142})
    gviz2 = visualizer.apply(heu_net_2, parameters={"format": "svg"})
    visualizer.view(gviz2)

if __name__ == "__main__":
    execute_script()
fit-alessandro-berti commented 1 year ago

Dear @CHINA-JACK-01

Thanks for signaling. We will fix this issue in the next release.

JackEnzo commented 1 year ago

Thanks! I will always support pm4py! @fit-alessandro-berti

fit-alessandro-berti commented 1 year ago

we fixed the issue in pm4py 2.3.2

JackEnzo commented 1 year ago

Hi,@fit-alessandro-berti, the "min_dfg_occurrences" bug are still in the 2.3.2. connection_bug

fit-alessandro-berti commented 1 year ago

Dear @JackEnzo according to the specified example (filtering on DFG occurrences >= 142) that is the correct result.

You can also try with other values (1, 500, ...). For example, with 500:

image

Why the problem is not solved in your opinion?

JackEnzo commented 1 year ago

Dear @fit-alessandro-berti, I personally think that no matter how the filter conditions change, “heu_net” should ensure that all nodes have ingoing and outgoing edges. Is it possible to try to remove filtered edges or nodes from the source “df” to generate a more elegant graph?

fit-alessandro-berti commented 1 year ago

No, that was not granted by the algorithm or possible yet ;) We'll work towards providing a "connected activities" parameter in future for the heuristics miner variants.

But this is unconnected to the scope of the original issue

JackEnzo commented 1 year ago

thank you for your reply