Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not same generation as paper #21

Open
Romathonat opened this issue Jan 8, 2018 · 1 comment
Open

Not same generation as paper #21

Romathonat opened this issue Jan 8, 2018 · 1 comment

Comments

@Romathonat
Copy link

Romathonat commented Jan 8, 2018

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).

def joinSet(itemSet, length):
  """Join a set with itself and returns the n-element itemsets"""
  return set([i.union(j) for i in itemSet for j in itemSet if len(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))
{frozenset({1, 2, 3, 4}), frozenset({1, 2, 3, 5}), frozenset({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

@wangych6
Copy link

I have the same confusion on the code, I think u're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants