Skip to content

fix typo in HDBSCAN example - #27158

Merged
jeremiedbb merged 3 commits into
scikit-learn:mainfrom
VladimirFokow:hdbscan-example-fix
Aug 30, 2023
Merged

jeremiedbb merged 3 commits into
scikit-learn:mainfrom
VladimirFokow:hdbscan-example-fix

Conversation

@VladimirFokow

Copy link
Copy Markdown
Contributor

The * scale code was missed, even though it was intended to be there to illustrate the point

What does this fix? Explain your changes.

On this page:
https://scikit-learn.org/stable/auto_examples/cluster/plot_hdbscan.html

The section "Scale Invariance" has:

One immediate advantage is that HDBSCAN is scale-invariant.

The purpose of the code example that follows is to show that HDBSCAN is scale-invariant: that it will assign meaningful clusters to the scaled data, unlike the DBSCAN (which is right above it).

The original authors simply forgot to scale the data in the loop.


I've tested my code changes - the HDBSCAN correctly assigns the clusters to the scaled data.

the ` * scale` code was missed, even though it was intended to be there
@github-actions

github-actions Bot commented Aug 24, 2023 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 221a5cb. Link to the linter CI: here

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @VladimirFokow, good catch !

@jeremiedbb
jeremiedbb enabled auto-merge (squash) August 30, 2023 13:08
hdb.probabilities_,
ax=axes[idx],
parameters={"scale": scale},
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks!

@jeremiedbb
jeremiedbb merged commit 989d299 into scikit-learn:main Aug 30, 2023
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 5, 2023
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 18, 2023
jeremiedbb added a commit that referenced this pull request Sep 20, 2023
Co-authored-by: jeremie du boisberranger <[email protected]>
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
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