-
Notifications
You must be signed in to change notification settings - Fork 4
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
add support for sparse X #86
Conversation
For completeness, I also tried the same estimation routine with |
Fix CI and add tests
8fb8e06
to
60bedf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor nitpicks; looking great! :)
Would you mind adding the following to the top of changelog.rst
?
0.11.0 (2024-09-xx)
-------------------
**New features**
* Add support for using ``scipy.sparse.csr_matrix`` as datastructure for covariates ``X``.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks a lot! :)
Feel free to squash and merge
We might add 1-2 changes at the beginning of next week and will probably release version 0.11.0 by end of next week. :) |
Adds support for CSR matrix inputs for all learners [not supported elsewhere, e.g. this open issue on econml]. Turned out to be not too bad since Kfold, integer slicing all work as usual with CSR matrices.
I added a
safe_len
method in utils and replaced all instances oflen(X)
withsafe_len(X)
(hence the many files touched - turned out no major substantive changes were required). This also means that theMatrix
class definition in typing now unions over array, dataframe, and csr_matrix.Also added an example notebook that documents massive (~8-10x) speed gains from using sparse inputs. I can't think of any obvious side-effects, but I'd defer to you folks on whether there are edge cases I haven't considered here.
Checklist
CHANGELOG.rst
entry