-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
CLN _hdbscan/_tree.pyx
algorithms refactor
#26011
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for simplifying the logic, @Micky774.
@lmcinnes I wonder if you could take a look and offer your thoughts as well, to potentially help reviewers make their decisions with confidence. I tried to avoid altering any necessary logic and instead focus on reducing/simplifying conditions as far as possible. |
lambda_val = sorted_lambdas[idx] | ||
|
||
if child == current_child: | ||
min_lambda = min(min_lambda, lambda_val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that child != current_child
in this algorithm since each child is unique to a single parent and hence only appears once. I suspect the removal of this line also simplifies the algorithm enough to remove the need for sorting entirely.
LGTM There are probably a number of things that could also be simplified, but it is probably best to keep things as close to the earlier implementation as possible for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference Issues/PRs
Addresses #24686
What does this implement/fix? Explain your changes.
Simplifies algorithms with reorganization of logic, removing/de-nesting extraneous
if
statements, and pruning unnecessary variablesAny other comments?
This is the final PR in the long series of backend cleanup PRs :)
CC: @thomasjpfan @jjerphan
You two may be interested in taking a look