Skip to content

[MRG+1] OPTICS remove redundant recursion #11985

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

Merged
merged 1 commit into from
Sep 8, 2018

Conversation

adrinjalali
Copy link
Member

See #11857 (comment)

This recursion will continue on local_maxima_points, which is sorted by their reachability_. Therefore all the following recursions will also fall into this condition. As a result it's redundant and not necessary to continue the recursion at the point where it falls into this condition.

@adrinjalali adrinjalali changed the title OPTICS remove redundant recursion [MRG+1] OPTICS remove redundant recursion Sep 3, 2018
@adrinjalali
Copy link
Member Author

@espg, I'd really like your review on this one.

@espg
Copy link
Contributor

espg commented Sep 4, 2018

I'm less certain on this and what the block of code does as this section is mostly @amyxzhang 's code. But, it's possible that there may be some loss of function related to hierarchy extraction? I know that the original code let you pick out which level of the hierarchy from the returned root node of the tree (i.e., converting to a dendrogram). I wasn't sure how the implement any of that with the sklearn API, so it's not implemented...but there could be a follow along PR that addresses that capability.

@adrinjalali
Copy link
Member Author

I also don't see why the original code is doing it, I may be missing something though. I've asked the question on the original repo (amyxzhang/OPTICS-Automatic-Clustering#3).

@amyxzhang
Copy link

I can't remember why I did this but your logic is sound, so I agree with it being removed.

@adrinjalali
Copy link
Member Author

Awesome, thanks @amyxzhang!

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks for catching this @adrinjalali !

@rth rth merged commit e5333f5 into scikit-learn:master Sep 8, 2018
@adrinjalali adrinjalali deleted the optics/recursion branch September 8, 2018 20:36
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Sep 9, 2018
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.

5 participants