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

fpmax gives wrong support #690

Closed
connesy opened this issue May 13, 2020 · 5 comments · Fixed by #692
Closed

fpmax gives wrong support #690

connesy opened this issue May 13, 2020 · 5 comments · Fixed by #692
Labels

Comments

@connesy
Copy link

connesy commented May 13, 2020

MWE:

>>> import pandas as pd
>>> import mlxtend
>>> pd.__version__
'1.0.2'
>>> mlxtend.__version__
'0.17.2'
>>> from mlxtend.frequent_patterns import fpmax
>>> df = pd.DataFrame([[1,1,0],[1,0,1],[0,0,1]], columns=['a','b','c'])
>>> print(df)
   a  b  c
0  1  1  0
1  1  0  1
2  0  0  1
>>> print(fpmax(df, min_support=0.01, use_colnames=True))
    support itemsets
0  0.333333   (b, a)
1  0.666667   (c, a)
@rasbt
Copy link
Owner

rasbt commented May 13, 2020

Yes, thanks, I think it should be 0.333333 for (a, c) as well. Let me CC @harenbergsd how implemented the algorithm

@rasbt rasbt added the Bug label May 13, 2020
@connesy
Copy link
Author

connesy commented May 13, 2020

I have tracked it down to commit 115278b. Before this commit (at commit ac0f0c1), the above example returns:

>>> fpmax(df, min_support=0.01, use_colnames=True)
    support itemsets
0  0.333333   (a, b)
1  0.333333   (a, c)

@harenbergsd
Copy link
Contributor

Thanks guys, I will check it out

@rasbt
Copy link
Owner

rasbt commented May 20, 2020

@connesy : Thanks to @harenbergsd , it should be fixed now :)

In order to use it, you can install the latest dev version via

pip install git+git://github.com/rasbt/mlxtend.git

(until the next version release)

@connesy
Copy link
Author

connesy commented May 22, 2020

Thanks!

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

Successfully merging a pull request may close this issue.

3 participants