Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation request: score interpretation for pm4py.analysis.simplicity_petri_net #517

Open
afparsons opened this issue Jan 30, 2025 · 1 comment

Comments

@afparsons
Copy link

Hello,

I am seeking clarity on the behavior of pm4py.analysis.simplicity_petri_net() function. The following are not immediately clear to me:

  • Is the float score bounded between zero and one?
    • If so, are the bounds inclusive or exclusive?
  • Score interpretation: do higher values mean simpler or more complex?
  • Score interpretation: is it the same for all three algorithms?

I've skimmed the two cited papers, but I think it would be very helpful to include this information in the function docstring.


Relevant blocks

@fit-alessandro-berti
Copy link
Contributor

fit-alessandro-berti commented Jan 31, 2025

Hi @afparsons, thanks for opening this issue!

Here’s some clarity on each of your questions:

  1. Is the float score bounded between zero and one?

    • Yes. In all three “simplicity” variants, the computed score lies within the interval ([0, 1]) or ((0, 1]). For example, in the arc_degree implementation, the formula is
      [
      \text{simplicity} = \frac{1}{1 + \max(\text{mean_degree} - k, 0)},
      ]
      which asymptotically approaches (0) but never reaches it (so it’s in ((0,1])). In other variants (e.g., Extended Cardoso, Extended Cyclomatic), the formula may allow the score to hit exactly (0) in edge cases. Either way, you will not see negative values or values greater than (1).
  2. Are the bounds inclusive or exclusive?

    • For the arc_degree variant, the upper bound (1) is inclusive (when (\text{mean_degree} \le k)), but the lower bound (0) is effectively exclusive because you only approach (0) asymptotically for very large mean arc degrees.
    • For the other two algorithms (Extended Cardoso, Extended Cyclomatic), the score is also designed to stay within ([0,1]); in practice, they often do include (0) in corner cases.
  3. Score interpretation: do higher values mean simpler or more complex?

    • A higher value corresponds to a simpler Petri net (fewer arcs/edges relative to places and transitions). A lower value means more complex.

We agree it would be very helpful to include these details directly in the docstring. Thanks again for the suggestion!

Hope that clarifies! Let us know if you have any further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants