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

fix fpmax issue (#570) with fptrees that contain no nodes #573

Merged
merged 6 commits into from
Aug 6, 2019

Conversation

harenbergsd
Copy link
Contributor

@harenbergsd harenbergsd commented Aug 3, 2019

Description

Fpmax had a bug with empty (other than root node) fptrees because it was basing the support calculation from nodes in the tree. I have changed it so that the root node in the tree contains the total support (ie the support of the conditional items that the tree is based on). Since every tree will have at least the root node this fixes the issue.

Related issues or pull requests

Fixes #570

Pull Request Checklist

  • Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • Ran PYTHONPATH='.' pytest ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • Checked for style issues by running flake8 ./mlxtend

@coveralls
Copy link

coveralls commented Aug 3, 2019

Coverage Status

Coverage increased (+0.1%) to 92.252% when pulling d42ac1b on harenbergsd:fpmax-bug-570 into ac0f0c1 on rasbt:master.

@harenbergsd
Copy link
Contributor Author

I am going to update and expand unit tests a bit, so will have one or more commits coming.

@rasbt
Copy link
Owner

rasbt commented Aug 4, 2019

Thanks for the update and addressing this issue!

I am going to update and expand unit tests a bit, so will have one or more commits coming.

Sounds good! I will wait with merging then.

@harenbergsd
Copy link
Contributor Author

I added some unit tests and refactored a bit. I moved FPMax specific code to test_fpmax. Since apriori and fpgrowth share the same code, I left the common tests in test_fpbase.

Ultimately, we'd like to run the exact same tests for fpgrowth, apriori, and apriori_low_mem, but I am not sure how to get a cleaner, more concise way to to do that...

@rasbt
Copy link
Owner

rasbt commented Aug 5, 2019

I just looked over the refactoring of the unit tests, and I think that's great and serves the purpose well enough -- no need to make it even more elegant I guess :). Looks like this should also be good to merge then? Thanks again for putting all the effort into it!

@harenbergsd
Copy link
Contributor Author

harenbergsd commented Aug 5, 2019 via email

@rasbt rasbt merged commit 115278b into rasbt:master Aug 6, 2019
@rasbt rasbt mentioned this pull request Jan 29, 2020
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

Successfully merging this pull request may close these issues.

FPMax issue with large datasets.
3 participants