-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
index type np.int32_t
causes issue in _csr_polynomial_expansion
#16803
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
Comments
Thanks for the report @jianlingzhong ! So scipy csr_matrix will automatically upcast I think we should use Cython fused types in Pull Request to fix it would be welcome. |
Thanks @rth.
The code compiles fine. However, the same problem still occurs. I need to change how
After this, it runs fine on my large input sparse matrix. This is less than ideal as I imagine we don't need to cast to If you have any suggestions on how to change this quickly, I'd be happy to submit a pull request. |
Uh oh!
There was an error while loading. Please reload this page.
I ran into an issue when trying to construct a ploynomial expansion feature with a large sparse matrix input:
And got the error
ValueError: negative column index found
:The problem is not with
scipy
as it correctly set the index type toint64
:And I believe the issue is with
sklearn.preprocess._data.py
, which callssklearn._csr_polynomial_expansion
, which in turn used anint32
for thec
code:scikit-learn/sklearn/preprocessing/_csr_polynomial_expansion.pyx
Line 11 in ada94ae
and:
scikit-learn/sklearn/preprocessing/_csr_polynomial_expansion.pyx
Line 51 in ada94ae
I wondering if there is a quick fix for this. Thanks!
The text was updated successfully, but these errors were encountered: