# pm4py.algo.discovery.dfg package

## pm4py.algo.discovery.dfg.algorithm module

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.dfg.algorithm.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
START_TIMESTAMP_KEY = 'pm4py:param:start_timestamp_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
class pm4py.algo.discovery.dfg.algorithm.Variants(value)[source]

Bases: enum.Enum

An enumeration.

CASE_ATTRIBUTES = <module 'pm4py.algo.discovery.dfg.variants.case_attributes' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\case_attributes.py'>
FREQUENCY = <module 'pm4py.algo.discovery.dfg.variants.native' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\native.py'>
FREQUENCY_GREEDY = <module 'pm4py.algo.discovery.dfg.variants.native' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\native.py'>
FREQ_TRIPLES = <module 'pm4py.algo.discovery.dfg.variants.freq_triples' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\freq_triples.py'>
NATIVE = <module 'pm4py.algo.discovery.dfg.variants.native' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\native.py'>
PERFORMANCE = <module 'pm4py.algo.discovery.dfg.variants.performance' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\performance.py'>
PERFORMANCE_GREEDY = <module 'pm4py.algo.discovery.dfg.variants.performance' from 'C:\\Users\\berti\\pm4py-core\\pm4py\\algo\\discovery\\dfg\\variants\\performance.py'>
pm4py.algo.discovery.dfg.algorithm.apply(log: Union[pm4py.objects.log.obj.EventLog, pm4py.objects.log.obj.EventStream, pandas.core.frame.DataFrame], parameters: Optional[Dict[Any, Any]] = None, variant=Variants.NATIVE) Dict[Tuple[str, str], float][source]

Calculates DFG graph (frequency or performance) starting from a log

Parameters
• log – Log

• parameters

Possible parameters passed to the algorithms:

Parameters.AGGREGATION_MEASURE -> performance aggregation measure (min, max, mean, median) Parameters.ACTIVITY_KEY -> Attribute to use as activity Parameters.TIMESTAMP_KEY -> Attribute to use as timestamp

• variant

Variant of the algorithm to use, possible values:
• Variants.NATIVE

• Variants.FREQUENCY

• Variants.FREQUENCY_GREEDY

• Variants.PERFORMANCE

• Variants.PERFORMANCE_GREEDY

• Variants.FREQ_TRIPLES

Returns

DFG graph

Return type

dfg

## pm4py.algo.discovery.dfg.parameters module

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.dfg.parameters.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
AGGREGATION_MEASURE = 'aggregationMeasure'
CASE_ID_KEY = 'pm4py:param:case_id_key'
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'
WINDOW = 'window'

## pm4py.algo.discovery.dfg.replacement module

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/>.

pm4py.algo.discovery.dfg.replacement.replace_values(dfg1, dfg2)[source]

Replace edge values specified in a DFG by values from a (potentially bigger) DFG

Parameters
• dfg1 – First specified DFG (where values of edges should be replaces)

• dfg2 – Second specified DFG (from which values should be taken)

Returns

First specified DFG with overrided values

Return type

dfg1