pm4py.evaluation.earth_mover_distance.variants package

Submodules

pm4py.evaluation.earth_mover_distance.variants.pyemd module

class pm4py.evaluation.earth_mover_distance.variants.pyemd.Parameters[source]

Bases: object

STRING_DISTANCE = 'string_distance'
pm4py.evaluation.earth_mover_distance.variants.pyemd.apply(lang1, lang2, parameters=None)[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 distance

Return type

emd_dist

pm4py.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.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 into hex characters

Return type

encoding

pm4py.evaluation.earth_mover_distance.variants.pyemd.normalized_levensthein(s1, s2)[source]

Normalized Levensthein distance

Parameters
  • s1 – First string

  • s2 – Second string

Returns

Distance

Return type

dist

Module contents