mlxtend icon indicating copy to clipboard operation
mlxtend copied to clipboard

"ValueError: min() arg is an empty sequence" with fpmax

Open Datanatole opened this issue 5 years ago • 2 comments

Hi,

I encounter this error when using fpmax. The following code derived from the example in the docs is reproducing the error ValueError: min() arg is an empty sequence :

           ['Dill', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'],
           ['Milk', 'Apple', 'Kidney Beans', 'Eggs'],
           ['Milk', 'Yogurt'],
           ['Corn', 'Onion', 'Onion', 'Kidney Beans', 'Ice cream', 'Eggs']]

import pandas as pd
from mlxtend.preprocessing import TransactionEncoder

te = TransactionEncoder()
te_ary = te.fit(dataset).transform(dataset)
df = pd.DataFrame(te_ary, columns=te.columns_)
from mlxtend.frequent_patterns import fpmax
fpmax(df, min_support=0.6, use_colnames=True)```

Hope this helps !

Datanatole avatar Dec 04 '19 14:12 Datanatole

Hi there,

this is an issue in mlxtend 0.17, indeed. There is a fix in the current master branch though (mlxtend 0.18.dev0). So, in the meantime, until the next stable version release, I recommend using the dev version from the master branch. You can install it as follows:

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

Best, Sebastian

On Dec 4, 2019, at 8:46 AM, Datanatole [email protected] wrote:

Hi,

I encounter this error when using fpmax. The following code derived from the example is reproducing the error ValueError: min() arg is an empty sequence :

`dataset = [['Milk', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'], ['Dill', 'Onion', 'Nutmeg', 'Kidney Beans', 'Eggs', 'Yogurt'], ['Milk', 'Apple', 'Kidney Beans', 'Eggs'], ['Milk', 'Yogurt'], ['Corn', 'Onion', 'Onion', 'Kidney Beans', 'Ice cream', 'Eggs']]

import pandas as pd from mlxtend.preprocessing import TransactionEncoder

te = TransactionEncoder() te_ary = te.fit(dataset).transform(dataset) df = pd.DataFrame(te_ary, columns=te.columns_) from mlxtend.frequent_patterns import fpmax fpmax(df, min_support=0.6, use_colnames=True)`

Hope this helps !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rasbt avatar Dec 04 '19 17:12 rasbt

Ok thank you !

Datanatole avatar Dec 04 '19 18:12 Datanatole