forked from SWISDATA/processintel
mining.base: absolute frequency thresholds use the wrong maximum, and slider values jump #11
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: medium (the absolute slider applies a different cutoff than the user set)
Where
app/mining_algorithms/base_mining.py:475-505,:507-542,:632-637,:669-783Problem
The UI offers Node/Edge Frequency (absolute) sliders next to the normalized ones. Filtering only ever uses the normalized value (
get_node_frequencies,filter_edge); the absolute slider only drives the normalized value through_sync_thresholds.Within one recalculation, that sync uses different maxima:
self.appearance_frequency, the unfiltered log, before the SPM filter runs (recalculate_model_filters, lines 690-694).get_node_frequencies).filtered_appearance_freqs.If the SPM filter removes the most frequent activity, these maxima differ. Example: the user sets "absolute ≥ 50", the unfiltered max is 200 and the SPM-filtered max is 100. Then norm = 0.25, nodes with count ≥ 25 are kept, and the slider jumps back to 25.
Also,
get_node_statisticsstores the normalized value fromself.node_frequenciesunder the key"absolute_frequency"(lines 523-538).Steps to reproduce
Expected behavior
Only nodes with an absolute frequency ≥ 50 are kept, and the slider keeps the value 50.
Actual behavior
A different cutoff is applied (e.g. ≥ 25) and the slider value jumps to that value.
Related: #46.
Fix
Filter on the absolute value directly, or derive both values from one consistently defined maximum (the one actually used for filtering). Fix or rename the
absolute_frequencyfield in the node statistics.from
issues/BUG-011-absolute-frequency-thresholds-use-wrong-basis.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The inconsistent normalization maxima and mislabeled
absolute_frequencyare supported. The ordering in point 1 needs correction:recalculate_model_filters()recomputes the SPM-filtered events/log at lines 685–688 before its first_sync_thresholds()call at 690–694. The actual defect is that the call still receives unfilteredself.appearance_frequency, whileget_node_frequencies()normalizes against counts in the already recomputed SPM-filtered log. This preserves the reported cutoff/jumping problem but corrects its explanation.Code references: app/mining_algorithms/base_mining.py:685, app/mining_algorithms/base_mining.py:690, app/mining_algorithms/base_mining.py:523.