You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the paper from Agrawal, the generation of candidates is different (formulated in sql query).
It is said that from itemsets (1,2,3), (1,2,4), (1,3,4), (1,3,5), (2,3,4), you have only (1,2,3,4) and (1,3,4,5) generated. With your approach, you have another, which is (1,3,4,5).
defjoinSet(itemSet, length):
"""Join a set with itself and returns the n-element itemsets"""returnset([i.union(j) foriinitemSetforjinitemSetiflen(i.union(j)) ==length])
itemset= [frozenset({1, 2, 3}), frozenset({1, 2, 4}), frozenset({1, 3, 4}), frozenset({1, 3, 5}), frozenset({2, 3, 4})]
print(joinSet(itemset, 4))
In the paper from Agrawal, the generation of candidates is different (formulated in sql query).
It is said that from itemsets (1,2,3), (1,2,4), (1,3,4), (1,3,5), (2,3,4), you have only (1,2,3,4) and (1,3,4,5) generated. With your approach, you have another, which is (1,3,4,5).
Moreover, I think you switched the name of variables currentLSet and currentCSet (L for Large itemset and C for Candidate itemset) here
The text was updated successfully, but these errors were encountered: