Tfidf mem fix#4941
Closed
aupiff wants to merge 4 commits intoscikit-learn:masterfrom
aupiff:tfidf-mem-fix
Closed
Conversation
so large datasets with > 2 billion nnz can be stored as a sparse matrix without integer overflow
Member
|
We used Also, this fails on Windows because |
Author
|
Maybe I should get rid of the 64-bit changes and just keep the memory fix? |
Member
|
splitting it up into two PRs would probably be good. |
Member
|
Yes. Mind you, it is possible to implement dynamic arrays with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
previously, line 760 in
text.pywould cause memory issues as
len(j_indices)is equal to the entire corpus' word count. I had issues with a dataset of 200,000 documents with ~4000 words each when many gigabytes would be allocated temporarily. I've eliminated the need for this line and theX.sum_duplicatescalculation without a perceptible performance hit.Additionally, for matrices with greater than 2 billion nnz,
np.intcandarray.array(str("i"))were insufficient for storing values ofindptrthat had to index into more than the (2^31 - 1)th position in the values orj_indicesarrays. I've changednp.intc->np.int64andarray.array(str("i"))->array.array(str("l"))to accommodate this possibility.