mining.inductive_infrequent: replace the InductiveMiningInfrequent class with a pure function #71

Open
opened 2026-10-09 12:22:03 +00:00 by ffrauenberger · 0 comments
Owner

Severity: improvement (part of #66; the miner's result depends on the history of its instance)
Requested by: the user (2026-10-09)

Where

  • app/mining_algorithms/inductive_mining_infrequent.py:16-36 — InductiveMiningInfrequent(InductiveMining); the constructor sets noise_threshold, _last_noise_threshold and _use_imf_filters on self.
  • app/mining_algorithms/inductive_mining_infrequent.py:38-73 — generate_graph writes the clamped noise_threshold to self, then calls the parent's generate_graph.
  • app/mining_algorithms/inductive_mining_infrequent.py:123, :141 — _inductive_mining_imf sets self._use_imf_filters to False and then True during the recursion.
  • app/mining_algorithms/inductive_mining_infrequent.py:200, :240, :323, :342 — the base cases and fallthroughs read self._use_imf_filters and self.noise_threshold.
  • app/mining_algorithms/inductive_mining_infrequent.py:32 — _last_noise_threshold is set but never read.
  • app/ui/inductive_miner_infrequent_ui/inductive_miner_infrequent_controller.py:65-77 — the controller reads noise_threshold back from the instance.

Problem

IMf passes a mode flag between recursion levels through self._use_imf_filters. A recursive call on a sublog sets the flag, and the caller sees the value the callee left behind. Whether a filter applies thus depends on the order of the calls, not on the arguments. #18 (the single-activity base-case filter is never applied) is one result of this.

Fix

Follow the plan in #66 (code#write-simple-functional-code):

  • mine_inductive_infrequent(log, params) -> MiningResult, with params holding noise_threshold and the parameters of mine_inductive.
  • Pass noise_threshold and the filter mode as arguments to the recursive functions instead of reading them from self.
  • Build on the module functions of the inductive miner (#70) instead of subclassing. Do #70 first.
  • Drop _last_noise_threshold.
  • Let InductiveMiningInfrequent delegate to the new function until the controller has moved, then remove it.

Check

  • A unit test calls mine_inductive_infrequent twice with the same log and params and gets equal results.
  • A test runs it with another noise_threshold first, then with the first again, and gets the same result as on a fresh call.
  • git grep -n "class InductiveMiningInfrequent\|_use_imf_filters" app returns nothing.

from a session on 2026-10-09, split from #66

**Severity:** improvement (part of #66; the miner's result depends on the history of its instance) **Requested by:** the user (2026-10-09) ## Where - `app/mining_algorithms/inductive_mining_infrequent.py:16-36` — `InductiveMiningInfrequent(InductiveMining)`; the constructor sets `noise_threshold`, `_last_noise_threshold` and `_use_imf_filters` on `self`. - `app/mining_algorithms/inductive_mining_infrequent.py:38-73` — `generate_graph` writes the clamped `noise_threshold` to `self`, then calls the parent's `generate_graph`. - `app/mining_algorithms/inductive_mining_infrequent.py:123`, `:141` — `_inductive_mining_imf` sets `self._use_imf_filters` to `False` and then `True` during the recursion. - `app/mining_algorithms/inductive_mining_infrequent.py:200`, `:240`, `:323`, `:342` — the base cases and fallthroughs read `self._use_imf_filters` and `self.noise_threshold`. - `app/mining_algorithms/inductive_mining_infrequent.py:32` — `_last_noise_threshold` is set but never read. - `app/ui/inductive_miner_infrequent_ui/inductive_miner_infrequent_controller.py:65-77` — the controller reads `noise_threshold` back from the instance. ## Problem IMf passes a mode flag between recursion levels through `self._use_imf_filters`. A recursive call on a sublog sets the flag, and the caller sees the value the callee left behind. Whether a filter applies thus depends on the order of the calls, not on the arguments. #18 (the single-activity base-case filter is never applied) is one result of this. ## Fix Follow the plan in #66 (`code#write-simple-functional-code`): - `mine_inductive_infrequent(log, params) -> MiningResult`, with `params` holding `noise_threshold` and the parameters of `mine_inductive`. - Pass `noise_threshold` and the filter mode as arguments to the recursive functions instead of reading them from `self`. - Build on the module functions of the inductive miner (#70) instead of subclassing. Do #70 first. - Drop `_last_noise_threshold`. - Let `InductiveMiningInfrequent` delegate to the new function until the controller has moved, then remove it. ## Check - A unit test calls `mine_inductive_infrequent` twice with the same log and params and gets equal results. - A test runs it with another `noise_threshold` first, then with the first again, and gets the same result as on a fresh call. - `git grep -n "class InductiveMiningInfrequent\|_use_imf_filters" app` returns nothing. --- from a session on 2026-10-09, split from #66
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#71
No description provided.