-
Notifications
You must be signed in to change notification settings - Fork 875
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
apriori.py line 224: ValueError: negative dimensions are not allowed #613
Comments
Below are the version of the package, Python 3.7.4
|
Hm, not sure about what's going on. Could also be related to the compression and a scipy bug. But isn't cumsum not always returning a int64 array to make sure these issues don't happen? E.g., In [9]: a = np.array(range(1000000), dtype=np.int32)
In [10]: a.dtype
Out[10]: dtype('int32')
In [11]: np.cumsum(a).dtype
Out[11]: dtype('int64') So, I am wondering how this happens with cumsum ... COuld you run the example above in your NumPy version, and of cumsum returns int32, you can try to see if updating to NumPy v1.17.2 helps |
Yes, it should be the problem. I will update numpy. |
Thanks for confirming. In this case, we probably should add a warning to the apriori package. I am opening this issue again to address this at some point. I.e., we could simply add an
|
Just wanted to chime in and say that I am also experiencing this issue (row 302 instead of 224), but I confirmed that I have the latest numpy:
I am using the sparse dtype instead of SparseDataFrame - when using SparseDataFrame with apriori it kills my Jupyter kernel. Dataframe (bools):
Versions:
|
I do not have a clear understanding of this issue, but it looks like some indices are too large, you may have to call apriori with |
mlxtend/mlxtend/frequent_patterns/apriori.py
Line 224 in 115278b
In my apriori.py, variable "combin" is a (4130975, 6) dataframe comprise of indices (dtype = int32).
In compressed.py, numpy cumsum takes the dtype from indices of "combin".
Negative values appeared after the numpy cumsum reached maximum of int32.
Not sure if it is an exception for numpy cumsum or mlxtend apriori.
The text was updated successfully, but these errors were encountered: