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

Reducing H_1 update broken #57

Closed
selting opened this issue Feb 1, 2023 · 3 comments
Closed

Reducing H_1 update broken #57

selting opened this issue Feb 1, 2023 · 3 comments

Comments

@selting
Copy link

selting commented Feb 1, 2023

Hello again,
thank you to @hprshayan for addressing #45 in #53.
However, the following example fails for me although all tests succeed:

from efficient_apriori.apriori import apriori
transactions = [(1, 2, 3), (1, 2, 3), (1, 2, 3), (1, 2), (2, 3)]
apriori(transactions, 0.4, 0.8)

This is due to H_1 being empty at the time of entering _ap_genrules. Thus, the check if len(itemset) <= (len(H_m[0]) + 1) will give an IndexError.

If you could confirm that the example also fails for you, I might get around to creating a PR.

@tommyod
Copy link
Owner

tommyod commented Feb 1, 2023

I can confirm that it fails here too.

Would reverting #53 fix this?

We need a test for this case! A PR would be greatly appreciated!

@hprshayan
Copy link
Contributor

hprshayan commented Feb 1, 2023

Hi @selting,
Thank you for the note. I confirm the example also fails for me for the reason you mentioned. I have a solution for that. I can create a PR.

tommyod pushed a commit that referenced this issue Feb 2, 2023
* Fixing H_1 reduction update in #53 (#57)
* Avoiding passing empty H_1 to _ap_genrules function

* Empty H_1 test added (#57)

* project reformated with black v23.1.0

* Update test_apriori.py

Benchmark commit hash added to  test_apriori.py
@tommyod
Copy link
Owner

tommyod commented Feb 8, 2023

Closed by #58

@tommyod tommyod closed this as completed Feb 8, 2023
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

3 participants