[MRG] Make OPTICS more memory efficient when calling kneighbors#12103
Merged
qinhanmin2014 merged 5 commits intoscikit-learn:masterfrom Sep 22, 2018
Merged
[MRG] Make OPTICS more memory efficient when calling kneighbors#12103qinhanmin2014 merged 5 commits intoscikit-learn:masterfrom
qinhanmin2014 merged 5 commits intoscikit-learn:masterfrom
Conversation
ogrisel
reviewed
Sep 18, 2018
sklearn/cluster/optics_.py
Outdated
|
|
||
| # OPTICS helper functions | ||
|
|
||
| def _calculate_core_distances_(self, X, nbrs, working_memory=None): |
Member
There was a problem hiding this comment.
As a non-native English speaker, I wonder if "calculate" to is natural or not. It sounds French to my ears and I would have thought that "compute" would be more idiomatic but I would love to get the feedback of a native English speaker.
Any way, it's a private function so it's not necessary to change this.
ogrisel
approved these changes
Sep 18, 2018
sklearn/cluster/optics_.py
Outdated
| ---------- | ||
| X : array, shape (n_samples, n_features) | ||
| The data. | ||
| nbrs : NearestNeighbors instance |
Member
There was a problem hiding this comment.
I would rather use "neighbors" instead of "nbrs" that parses as "numbers" in my brains.
qinhanmin2014
approved these changes
Sep 22, 2018
Member
qinhanmin2014
left a comment
There was a problem hiding this comment.
LGTM, I'll merge this one for other OPTICS PRs.
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.
Fixes #12098
It calls
kneighborson chunks to avoid exceedingworking_memory.