Skip to content

Commit 7c4ad5c

Browse files
committed
MIN Add explanatory comment
1 parent 5758d97 commit 7c4ad5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ch08/apriori/apriori_naive.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@
3434
print("At iteration {}, number of frequent baskets: {}".format(
3535
i, len(itemsets)))
3636
nextsets = []
37+
3738
tested = set()
3839
for it in itemsets:
3940
for v in valid:
4041
if v not in it:
4142
# Create a new candidate set by adding v to it
4243
c = (it | frozenset([v]))
44+
45+
# Check if we have tested it already:
4346
if c in tested:
4447
continue
4548
tested.add(c)

0 commit comments

Comments
 (0)