mining.base: deduplicate the filter pipeline in BaseMining #49

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

Severity: improvement (medium)

Where

  • app/mining_algorithms/base_mining.py:38-146 vs. :669-753

Problem

The sequence SPM filter → node-frequency filter → edge frequencies → start/end nodes → filtered succession matrix → clustering is written out twice (about 70 lines) in BaseMining.__init__ and recalculate_model_filters. The copies have already drifted apart:

  • __init__ computes absolute thresholds itself and writes session state directly, while the recalculation path uses _sync_thresholds
  • the clustering guard for empty node sets differs between the two copies
  • some algorithms recompute state on top: AlphaMining/FuzzyMining call _calculate_filtered_model_state() in both __init__ and generate_graph, and HeuristicMining.generate_graph recomputes start_nodes/end_nodes before the filters are recalculated

Fix

  • __init__ sets defaults and calls a single _apply_filters() (the current recalculate_model_filters body without the early-return cache)
  • Algorithms hook in through one overridable method

from issues/ARCH-004-duplicated-filter-pipeline-in-base-mining.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** improvement (medium) ## Where - `app/mining_algorithms/base_mining.py:38-146` vs. `:669-753` ## Problem The sequence SPM filter → node-frequency filter → edge frequencies → start/end nodes → filtered succession matrix → clustering is written out twice (about 70 lines) in `BaseMining.__init__` and `recalculate_model_filters`. The copies have already drifted apart: - `__init__` computes absolute thresholds itself and writes session state directly, while the recalculation path uses `_sync_thresholds` - the clustering guard for empty node sets differs between the two copies - some algorithms recompute state on top: `AlphaMining`/`FuzzyMining` call `_calculate_filtered_model_state()` in both `__init__` and `generate_graph`, and `HeuristicMining.generate_graph` recomputes `start_nodes`/`end_nodes` before the filters are recalculated ## Fix - `__init__` sets defaults and calls a single `_apply_filters()` (the current `recalculate_model_filters` body without the early-return cache) - Algorithms hook in through one overridable method --- from `issues/ARCH-004-duplicated-filter-pipeline-in-base-mining.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#49
No description provided.