pm4py.algo.evaluation.earth_mover_distance.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.evaluation.earth_mover_distance.variants.pyemd 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.evaluation.earth_mover_distance.variants.pyemd.Parameters[source]#

Bases: object

STRING_DISTANCE = 'string_distance'#
pm4py.algo.evaluation.earth_mover_distance.variants.pyemd.normalized_levensthein(s1, s2)[source]#

Normalized Levensthein distance

Parameters#

s1

First string

s2

Second string

Returns#

dist

Distance

pm4py.algo.evaluation.earth_mover_distance.variants.pyemd.get_act_correspondence(activities, parameters=None)[source]#

Gets an encoding for each activity

Parameters#

activities

Activities of the two languages

parameters

Parameters

Returns#

encoding

Encoding into hex characters

pm4py.algo.evaluation.earth_mover_distance.variants.pyemd.encode_two_languages(lang1, lang2, parameters=None)[source]#

Encode the two languages into hexadecimal strings

Parameters#

lang1

Language 1

lang2

Language 2

parameters

Parameters of the algorithm

Returns#

enc1

Encoding of the first language

enc2

Encoding of the second language

pm4py.algo.evaluation.earth_mover_distance.variants.pyemd.apply(lang1: Dict[List[str], float], lang2: Dict[List[str], float], parameters: Optional[Dict[Union[str, Parameters], Any]] = None) float[source]#

Calculates the EMD distance between the two stochastic languages

Parameters#

lang1

First language

lang2

Second language

parameters
Parameters of the algorithm, including:
  • Parameters.STRING_DISTANCE: function that accepts two strings and returns a distance

Returns#

emd_dist

EMD distance