We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b238a53 commit 42c9856Copy full SHA for 42c9856
fp_growth.py
@@ -46,9 +46,9 @@ def clean_transaction(transaction):
46
transaction.sort(key=lambda v: items[v], reverse=True)
47
return transaction
48
49
- tree = FPTree()
+ master = FPTree()
50
for transaction in imap(clean_transaction, processed_transactions):
51
- tree.add(transaction)
+ master.add(transaction)
52
53
def find_with_suffix(tree, suffix):
54
for item, nodes in tree.items():
@@ -66,7 +66,7 @@ def find_with_suffix(tree, suffix):
66
yield s # pass along the good news to our caller
67
68
# Search for frequent itemsets, and yield the results we find.
69
- for s in find_with_suffix(tree, []):
+ for s in find_with_suffix(master, []):
70
yield s
71
72
class FPTree(object):
0 commit comments