mining.genetic: start, end and loop measures ignore trace frequencies #17

Open
opened 2026-10-06 13:47:24 +00:00 by ffrauenberger · 0 comments
Owner

Severity: medium (the measures are wrong for logs with repeated variants)

Where

  • app/mining_algorithms/genetic_mining.py:203-242

Problem

follows[a, b] for real activities comes from filtered_succession_matrix, which is frequency-weighted. The counts for the virtual start/end arcs and the length-two-loop counts L2L iterate over the keys of node_frequency_filtered_log (trace variants) and add 1:

for trace in self.node_frequency_filtered_log:      # variants, frequency ignored
    ...
    np.add.at(follows, (a[start_mask], b[start_mask]), 1)
    ...
    np.add.at(L2L, (a[mask], b[mask]), 1)

The two kinds of counts are therefore on different scales: a variant seen 10,000 times weighs the same as one seen once in S(t), E(t) and the L2L-based dependencies.

Steps to reproduce

  1. Import a log with one dominant variant and some rare variants that start or end with different activities
  2. Run the Genetic Miner
  3. Compare the computed start/end measures with the actual trace frequencies

Expected behavior

Start, end and L2L counts are weighted by variant frequency, like the succession matrix.

Actual behavior

Each variant counts once. Rare variants influence start/end and loop structure as much as dominant ones, which biases the initial population and hurts convergence and model quality.

Fix

Iterate over .items() and add freq instead of 1.


from issues/BUG-017-genetic-miner-start-end-and-l2l-measures-ignore-trace-frequency.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** medium (the measures are wrong for logs with repeated variants) ## Where - `app/mining_algorithms/genetic_mining.py:203-242` ## Problem `follows[a, b]` for real activities comes from `filtered_succession_matrix`, which is frequency-weighted. The counts for the virtual `start`/`end` arcs and the length-two-loop counts `L2L` iterate over the **keys** of `node_frequency_filtered_log` (trace variants) and add `1`: ```python for trace in self.node_frequency_filtered_log: # variants, frequency ignored ... np.add.at(follows, (a[start_mask], b[start_mask]), 1) ... np.add.at(L2L, (a[mask], b[mask]), 1) ``` The two kinds of counts are therefore on different scales: a variant seen 10,000 times weighs the same as one seen once in `S(t)`, `E(t)` and the L2L-based dependencies. ### Steps to reproduce 1. Import a log with one dominant variant and some rare variants that start or end with different activities 2. Run the Genetic Miner 3. Compare the computed start/end measures with the actual trace frequencies ### Expected behavior Start, end and L2L counts are weighted by variant frequency, like the succession matrix. ### Actual behavior Each variant counts once. Rare variants influence start/end and loop structure as much as dominant ones, which biases the initial population and hurts convergence and model quality. ## Fix Iterate over `.items()` and add `freq` instead of `1`. --- from `issues/BUG-017-genetic-miner-start-end-and-l2l-measures-ignore-trace-frequency.md` (code analysis of commit 6bcc646, 2026-10-03)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#17
No description provided.