-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
EXA Calculate number of noise points in plot_dbscan.py #12428
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
EXA Calculate number of noise points in plot_dbscan.py #12428
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.
LGTM, thanks @koenvandevelde
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.
Thanks!
@@ -34,8 +34,10 @@ | |||
|
|||
# Number of clusters in labels, ignoring noise if present. | |||
n_clusters_ = len(set(labels)) - (1 if -1 in labels else 0) | |||
n_noise_ = list(labels).count(-1) |
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.
The numpy idiom might rather be (labels == -1).sum()
. But I suppose I'm fine either way
This reverts commit 9b4ea74.
This reverts commit 9b4ea74.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?