-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Adding accept_large_sparse flag to SGDRegressor #18090
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
Adding accept_large_sparse flag to SGDRegressor #18090
Conversation
|
Does SGDRegressor work with |
|
Please add a test with a 64bit sparse matrix. I don't think it's this simple, but I'd happily be proven wrong |
|
I think this PR partially addresses #11355 |
|
I do not think
The dtype of TLDR: I think this is a hard task that involves going through the Cython files and making sure that int64 indices work with templating or fused types. |
|
@thomasjpfan makes sense -- I guess it would be one thing if we'd just need to make admittedly I don't have a ton of time to work on this so happy to keep slowly playing with this PR for a bit ... but I don't think it's something I have a lot of time to dedicate to closing out, so feel free to close this |
Most of the complication comes from needing to support 32bit and 64bit indices.
I'm okay with closing. Thank you for working on this issue. |
Adds the accept_large_sparse argument to
BaseSGDRegressor.fit()(and similar methods in subclasses).I'm seeing that in [MRG] Large sparse matrix support #11327, support was added for sparse matrices with 64-bit integer indices, but this support was only plumbed in for
sklearn/linear_model/_logistic.py. It's possible there's a deeper reason for why 64-bit support isn't possible (which I am not aware of), but if it's just a matter of adding the right plumbing this should do the trick.This should fix the error:
ValueError: Only sparse matrices with 32-bit integer indices are accepted. Got int64 indices.encountered when trying to fit anSGDRegressormodel with 64-bit sparse matrices.Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?