Improve efficiency of `__getitem__`
Open
Nobody has claimed this yet.
code quality
performance
- Dominant language
- Python
- Stars
- 140
- Forks
- 10
- Avg merge
- 18h 17m
- Merged PRs (30d)
- 2
Description
Currently, our approach for some of the __getitem__ methods is inefficient. For example, column subsetting for CategoricalMatrix converts the full matrix to a csc_matrix.
Here's a list to update with potential improvements:
DenseMatrix: nothing to do. Already optimized withnp.ndarraySparseMatrix: nothing to do. Already optimized withsps.csc_matrixCategoricalMatrix:- row: nothing to do, trivial
- column: create a SparseMatrix with only the subset of columns/rows selected
SplitMatrix:- Test thoroughly all the potential ways to index
StandardizedMatrix- Not sure if columns subset with only one row works
- Write docstrings for expected behavior
- Write tests covering all expected behavior
Contributor guide
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.
Research direction
Start by locating the getitem implementations for CategoricalMatrix, SplitMatrix, and StandardizedMatrix, then inspect how each indexing mode is currently handled. Improve the listed inefficient or uncertain cases, document expected behavior, and add tests covering all specified indexing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100