Skip to content
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

Adjacency-constrained hierarchical clustering? #230

Open
biona001 opened this issue Jun 14, 2022 · 1 comment
Open

Adjacency-constrained hierarchical clustering? #230

biona001 opened this issue Jun 14, 2022 · 1 comment
Labels

Comments

@biona001
Copy link

biona001 commented Jun 14, 2022

Hello, thank you for the great package. This is a question rather than a bug report.

I wonder if this package supports adjacency-constrained clustering? Given distance matrix, I want to ensure that my clusters are all "contiguous"

For example, hclust(1 .- cor(x)) results in non-continuous members:

julia> x = rand(5, 5)

julia> cutree(hclust(1 .- cor(x)), k = 2)
5-element Vector{Int64}:
 1
 1
 2
 1
 1

I need something like 1, 1, 2, 2, 2 where cluster members are contiguous and increasing.

Thank you in advance.

@biona001
Copy link
Author

I think I have a rough idea how to do this. Basically, at each merge step, I will only consider merge 2 clusters if they are adjacent and has the smallest distance.

If someone can briefly walk me through the logic of the code, I will love to add this as an option to the package. I will also try to decipher the package myself, of course.

@alyst alyst added the feature label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants