tslearn-team / tslearn-team/tslearn
Reduce memory usage of DTW warping path matrix via using sparse matrix in scipy.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 384
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 11
Description
I am sometimes frustrated that tslearn cannot handle extremely large time series data set because of running out of memory in big-data sets, e.g., 100k time series samples each of which is with over 1000 ticks.
A simple solution is to use scipy.sparse.coo_matrix instead of the common dense numpy's arrays in _subgradient_valence_warping to get the dtw warping matrix list_w_k. I think this improvement perhaps work in most of big-data cases.
There might be other possible improvements for reducing memory and computation costs, and I will be happy to tackle them if convenient.
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 _subgradient_valence_warping and inspect how the DTW warping matrix list_w_k is constructed. Evaluate whether scipy.sparse.coo_matrix can replace the dense NumPy arrays without changing the algorithm, then compare memory use and computation on large time-series inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- machine-learning, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100