pm4py.algo.discovery.heuristics.variants package#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

Submodules#

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

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.discovery.heuristics.variants.classic.Parameters(value)[source]#

Bases: Enum

An enumeration.

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: Optional[Dict[Union[str, Parameters], Any]] = 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: Optional[Dict[Union[str, Parameters], Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Union[str, Parameters], Any]] = 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#

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.discovery.heuristics.variants.plusplus.Parameters(value)[source]#

Bases: Enum

An enumeration.

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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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: Optional[Dict[Any, Any]] = 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]#