pm4py.algo.discovery.heuristics.variants package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

pm4py.algo.discovery.heuristics.variants.classic module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.discovery.heuristics.variants.classic.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
DEPENDENCY_THRESH = 'dependency_thresh'#
AND_MEASURE_THRESH = 'and_measure_thresh'#
MIN_ACT_COUNT = 'min_act_count'#
MIN_DFG_OCCURRENCES = 'min_dfg_occurrences'#
DFG_PRE_CLEANING_NOISE_THRESH = 'dfg_pre_cleaning_noise_thresh'#
LOOP_LENGTH_TWO_THRESH = 'loop_length_two_thresh'#
HEU_NET_DECORATION = 'heu_net_decoration'#
pm4py.algo.discovery.heuristics.variants.classic.apply(log: EventLog, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters#

log

Event log

parameters

Possible parameters of the algorithm, including:

  • Parameters.ACTIVITY_KEY

  • Parameters.TIMESTAMP_KEY

  • Parameters.CASE_ID_KEY

  • Parameters.DEPENDENCY_THRESH

  • Parameters.AND_MEASURE_THRESH

  • Parameters.MIN_ACT_COUNT

  • Parameters.MIN_DFG_OCCURRENCES

  • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

  • Parameters.LOOP_LENGTH_TWO_THRESH

Returns#

net

Petri net

im

Initial marking

fm

Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_pandas(df: DataFrame, parameters: Dict[str | Parameters, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters#

df

Pandas dataframe

parameters

Possible parameters of the algorithm, including: activity_key, case_id_glue, timestamp_key, dependency_thresh, and_measure_thresh, min_act_count, min_dfg_occurrences, dfg_pre_cleaning_noise_thresh, loops_length_two_thresh

Returns#

net

Petri net

im

Initial marking

fm

Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_dfg(dfg: Dict[Tuple[str, str], int], activities=None, activities_occurrences=None, start_activities=None, end_activities=None, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using Heuristics Miner

Parameters#

dfg

Directly-Follows Graph

activities

(If provided) list of activities of the log

activities_occurrences

(If provided) dictionary of activities occurrences

start_activities

(If provided) dictionary of start activities occurrences

end_activities

(If provided) dictionary of end activities occurrences

parameters

Possible parameters of the algorithm, including:

  • Parameters.ACTIVITY_KEY

  • Parameters.TIMESTAMP_KEY

  • Parameters.CASE_ID_KEY

  • Parameters.DEPENDENCY_THRESH

  • Parameters.AND_MEASURE_THRESH

  • Parameters.MIN_ACT_COUNT

  • Parameters.MIN_DFG_OCCURRENCES

  • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

  • Parameters.LOOP_LENGTH_TWO_THRESH

Returns#

net

Petri net

im

Initial marking

fm

Final marking

pm4py.algo.discovery.heuristics.variants.classic.apply_heu(log: EventLog, parameters: Dict[Any, Any] | None = None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters#

log

Event log

parameters

Possible parameters of the algorithm, including:

  • Parameters.ACTIVITY_KEY

  • Parameters.TIMESTAMP_KEY

  • Parameters.CASE_ID_KEY

  • Parameters.DEPENDENCY_THRESH

  • Parameters.AND_MEASURE_THRESH

  • Parameters.MIN_ACT_COUNT

  • Parameters.MIN_DFG_OCCURRENCES

  • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

  • Parameters.LOOP_LENGTH_TWO_THRESH

Returns#

heu

Heuristics Net

pm4py.algo.discovery.heuristics.variants.classic.apply_heu_pandas(df: DataFrame, parameters: Dict[str | Parameters, Any] | None = None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters#

df

Pandas dataframe

parameters

Possible parameters of the algorithm, including:

  • Parameters.ACTIVITY_KEY

  • Parameters.TIMESTAMP_KEY

  • Parameters.CASE_ID_KEY

  • Parameters.DEPENDENCY_THRESH

  • Parameters.AND_MEASURE_THRESH

  • Parameters.MIN_ACT_COUNT

  • Parameters.MIN_DFG_OCCURRENCES

  • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

  • Parameters.LOOP_LENGTH_TWO_THRESH

Returns#

heu

Heuristics Net

pm4py.algo.discovery.heuristics.variants.classic.apply_heu_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, dfg_window_2=None, freq_triples=None, performance_dfg=None, parameters=None) HeuristicsNet[source]#

Discovers an Heuristics Net using Heuristics Miner

Parameters#

dfg

Directly-Follows Graph

activities

(If provided) list of activities of the log

activities_occurrences

(If provided) dictionary of activities occurrences

start_activities

(If provided) dictionary of start activities occurrences

end_activities

(If provided) dictionary of end activities occurrences

dfg_window_2

(If provided) DFG of window 2

freq_triples

(If provided) Frequency triples

performance_dfg

(If provided) Performance DFG

parameters

Possible parameters of the algorithm, including:

  • Parameters.ACTIVITY_KEY

  • Parameters.TIMESTAMP_KEY

  • Parameters.CASE_ID_KEY

  • Parameters.DEPENDENCY_THRESH

  • Parameters.AND_MEASURE_THRESH

  • Parameters.MIN_ACT_COUNT

  • Parameters.MIN_DFG_OCCURRENCES

  • Parameters.DFG_PRE_CLEANING_NOISE_THRESH

  • Parameters.LOOP_LENGTH_TWO_THRESH

Returns#

heu

Heuristics Net

pm4py.algo.discovery.heuristics.variants.classic.calculate(heu_net, dependency_thresh=0.5, and_measure_thresh=0.65, min_act_count=1, min_dfg_occurrences=1, dfg_pre_cleaning_noise_thresh=0.05, loops_length_two_thresh=0.5, parameters=None)[source]#

Calculate the dependency matrix, populate the nodes

Parameters#

dependency_thresh

(Optional) dependency threshold

and_measure_thresh

(Optional) AND measure threshold

min_act_count

(Optional) minimum number of occurrences of an activity

min_dfg_occurrences

(Optional) minimum dfg occurrences

dfg_pre_cleaning_noise_thresh

(Optional) DFG pre cleaning noise threshold

loops_length_two_thresh

(Optional) loops length two threshold

parameters

Other parameters of the algorithm

pm4py.algo.discovery.heuristics.variants.plusplus module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.discovery.heuristics.variants.plusplus.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

ACTIVITY_KEY = 'pm4py:param:activity_key'#
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
CASE_ID_KEY = 'pm4py:param:case_id_key'#
DEPENDENCY_THRESH = 'dependency_thresh'#
AND_MEASURE_THRESH = 'and_measure_thresh'#
MIN_ACT_COUNT = 'min_act_count'#
MIN_DFG_OCCURRENCES = 'min_dfg_occurrences'#
HEU_NET_DECORATION = 'heu_net_decoration'#
pm4py.algo.discovery.heuristics.variants.plusplus.apply(log: EventLog, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters#

log

Event log

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns#

net

Petri net

im

Initial marking

fm

Final marking

pm4py.algo.discovery.heuristics.variants.plusplus.apply_pandas(df: DataFrame, parameters: Dict[Any, Any] | None = None) Tuple[PetriNet, Marking, Marking][source]#

Discovers a Petri net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters#

df

Dataframe

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns#

net

Petri net

im

Initial marking

fm

Final marking

pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu(log: EventLog, parameters: Dict[Any, Any] | None = None) HeuristicsNet[source]#

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters#

log

Event log

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns#

heu_net

Heuristics net

pm4py.algo.discovery.heuristics.variants.plusplus.discover_abstraction_log(log: EventLog, parameters: Dict[Any, Any] | None = None) Tuple[Any, Any, Any, Any, Any, Any, Any][source]#

Discovers an abstraction from a log that is useful for the Heuristics Miner ++ algorithm

Parameters#

log

Event log

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY

Returns#

start_activities

Start activities

end_activities

End activities

activities_occurrences

Activities along with their number of occurrences

dfg

Directly-follows graph

performance_dfg

(Performance) Directly-follows graph

sojourn_time

Sojourn time for each activity

concurrent_activities

Concurrent activities

pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu_pandas(df: DataFrame, parameters: Dict[Any, Any] | None = None) HeuristicsNet[source]#

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters#

df

Dataframe

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns#

heu_net

Heuristics net

pm4py.algo.discovery.heuristics.variants.plusplus.discover_abstraction_dataframe(df: DataFrame, parameters: Dict[Any, Any] | None = None) Tuple[Any, Any, Any, Any, Any, Any, Any][source]#

Discovers an abstraction from a dataframe that is useful for the Heuristics Miner ++ algorithm

Parameters#

df

Dataframe

parameters

Parameters of the algorithm, including: - Parameters.ACTIVITY_KEY - Parameters.START_TIMESTAMP_KEY - Parameters.TIMESTAMP_KEY - Parameters.CASE_ID_KEY

Returns#

start_activities

Start activities

end_activities

End activities

activities_occurrences

Activities along with their number of occurrences

dfg

Directly-follows graph

performance_dfg

(Performance) Directly-follows graph

sojourn_time

Sojourn time for each activity

concurrent_activities

Concurrent activities

pm4py.algo.discovery.heuristics.variants.plusplus.discover_heu_net_plus_plus(start_activities, end_activities, activities_occurrences, dfg, performance_dfg, sojourn_time, concurrent_activities, parameters: Dict[Any, Any] | None = None)[source]#

Discovers an heuristics net using the Heuristics Miner ++ algorithm

Implements the approach described in Burattin, Andrea, and Alessandro Sperduti. “Heuristics Miner for Time Intervals.” ESANN. 2010.

https://andrea.burattin.net/public-files/publications/2010-esann-slides.pdf

Parameters#

start_activities

Start activities

end_activities

End activities

activities_occurrences

Activities along with their number of occurrences

dfg

Directly-follows graph

performance_dfg

(Performance) Directly-follows graph

sojourn_time

Sojourn time for each activity

concurrent_activities

Concurrent activities

parameters

Parameters of the algorithm, including: - Parameters.DEPENDENCY_THRESH - Parameters.AND_MEASURE_THRESH - Parameters.MIN_ACT_COUNT - Parameters.MIN_DFG_OCCURRENCES - Parameters.HEU_NET_DECORATION

Returns#

heu_net

Heuristics net

pm4py.algo.discovery.heuristics.variants.plusplus.calculate(heu_net: HeuristicsNet, dependency_thresh: float, and_measure_thresh: float, heu_net_decoration: str) HeuristicsNet[source]#

Calculates the dependency matrix and the AND measures using the Heuristics Miner ++ formulas

Parameters#

heu_net

Heuristics net

dependency_thresh

Dependency threshold

and_measure_thresh

AND measure threshold

heu_net_decoration

Decoration to use (frequency/performance)

Returns#

heu_net

Heuristics net

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_dependency(heu_net: HeuristicsNet, dependency_thresh: float, heu_net_decoration: str) HeuristicsNet[source]#

Calculates the dependency matrix using the Heuristics Miner ++ formula

Parameters#

heu_net

Heuristics net

dependency_thresh

Dependency threshold

heu_net_decoration

Decoration to include (frequency/performance)

Returns#

heu_net

Heuristics net (enriched)

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_and_out_measure(heu_net: HeuristicsNet, and_measure_thresh: float) HeuristicsNet[source]#

Calculates the AND measure for outgoing edges using the Heuristics Miner ++ formula

Parameters#

heu_net

Heuristics net

and_measure_thresh

And measure threshold

Returns#

heu_net

Heuristics net (enriched)

pm4py.algo.discovery.heuristics.variants.plusplus.calculate_and_in_measure(heu_net: HeuristicsNet, and_measure_thresh: float) HeuristicsNet[source]#

Calculates the AND measure for incoming edges using the Heuristics Miner ++ formula

Parameters#

heu_net

Heuristics net

and_measure_thresh

And measure threshold

Returns#

heu_net

Heuristics net (enriched)

pm4py.algo.discovery.heuristics.variants.plusplus.apply_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, parameters=None)[source]#
pm4py.algo.discovery.heuristics.variants.plusplus.apply_heu_dfg(dfg, activities=None, activities_occurrences=None, start_activities=None, end_activities=None, dfg_window_2=None, freq_triples=None, parameters=None)[source]#