8000 ENH Avoid redundant computation in OPTICS by jnothman · Pull Request #12094 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

ENH Avoid redundant computation in OPTICS #12094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jnothman
Copy link
Member

This may not make runtime much faster on simple examples, but should reduce memory and computation asymptotically. It also avoids potential problems (?!) in the mixing of sklearn.neighbors and sklearn.metrics distance functions...

This may not make runtime much faster on simple examples, but should reduce memory and computation asymptotically
@jnothman
Copy link
Member Author

I put this together prior to looking at #12049 (comment) where @espg refutes the benefit of such changes. I'll look into this soon.

@jnothman jnothman closed this Sep 17, 2018
res = nbrs.radius_neighbors(X[idx:idx + 1], radius=self.max_eps)
(neigh_dist,), (neigh_idx,) = res
if len(neigh_idx) < self.min_samples:
core_dist = nbrs.kneighbors(X[point:point + 1],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary. If there are less than min_samples, the value is defined to be "undefined", c.f. OPTICS paper.

@jnothman
Copy link
Member Author
jnothman commented Sep 17, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0