-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'powl_ISJ' into 'integration'
POWL ISJournal updates See merge request process-mining/pm4py/pm4py-core!1185
- Loading branch information
Showing
38 changed files
with
1,121 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from enum import Enum, auto | ||
from collections import Counter | ||
from pm4py.algo.discovery.inductive.dtypes.im_ds import IMDataStructureUVCL | ||
|
||
|
||
class FilteringType(Enum): | ||
DYNAMIC = auto() | ||
DECREASING_FACTOR = auto() | ||
|
||
|
||
DEFAULT_FILTERING_TYPE = FilteringType.DECREASING_FACTOR | ||
FILTERING_THRESHOLD = "filtering_threshold" | ||
FILTERING_TYPE = "filtering_type" | ||
|
||
|
||
def filter_most_frequent_variants(log): | ||
to_remove_freq = min([freq for var, freq in log.items()]) | ||
new_log = Counter() | ||
for var, freq in log.items(): | ||
if freq == to_remove_freq: | ||
continue | ||
new_log[var] = freq | ||
|
||
return IMDataStructureUVCL(new_log) | ||
|
||
|
||
def filter_most_frequent_variants_with_decreasing_factor(log, decreasing_factor): | ||
sorted_variants = sorted(log, key=log.get, reverse=True) | ||
new_log = Counter() | ||
|
||
already_added_sum = 0 | ||
prev_var_count = -1 | ||
|
||
for variant in sorted_variants: | ||
frequency = log[variant] | ||
if already_added_sum == 0 or frequency > decreasing_factor * prev_var_count: | ||
new_log[variant] = frequency | ||
already_added_sum = already_added_sum + frequency | ||
prev_var_count = frequency | ||
else: | ||
break | ||
|
||
return IMDataStructureUVCL(new_log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
pm4py/algo/discovery/powl/inductive/variants/clustering/__init__.py
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
pm4py/algo/discovery/powl/inductive/variants/dynamic_clustering/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from pm4py.algo.discovery.powl.inductive.variants.dynamic_clustering import * |
Oops, something went wrong.