Sparse matrix from formula
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing patsy's formula and design-matrix APIs and checking whether any sparse matrix support already exists. Compare the requested behavior with R's sparse.model.matrix, especially formulas containing interactions. Done means formulas with many categorical variables and interactions can produce a sparse design matrix without creating a dense intermediate matrix.
Written by the indexing model from the issue text.
Description
Is it currently possible to build a sparse design matrix from a formula? This is desirable for formulas with lot of categorical variables and their interactions, which are naturally represented as a sparse matrix of zeros and a relatively few ones. R sparse.model.matrix produces an sparse matrix but, when the model includes interactions, it fallbacks to the standard model.matrix so a dense matrix is created as an intermediate step. I don't know if patsy includes any sparse matrix support at all; in case it doesn't consider this a request for enhancement.
- Dominant language
- Python
- Stars
- 990
- Forks
- 113
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pydata/patsy
-
VarLookupDict should implement __iter__, causes CPython crash when using statsmodels in marimo notebookPossibly taken @kouyouqi123 claimed this 173 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Add link to license in readmePossibly taken @zheng-guannan577 claimed this 9 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Nullable pandas dtypes crash in categorical handling: "Cannot interpret 'BooleanDtype' as a data type"Possibly taken @RaphaelFakhri claimed this 15 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
cc() truncates periodic coordinates for integer input with fractional boundsPossibly taken @ktz03 claimed this 39 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
abetlen/llama-cpp-python#2424 ·
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
jqueryscript/awesome-claude-code#1009 ·
-
tests
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day