0
$\begingroup$

In my clustering project, I need to customize the linkage function, so that after each cluster merging I can update the inter-cluster distance in my own way.

Currently I'm using scikit-learn AgglomerativeClustering, which seems not having this customizable feature. After a quick glance in scipy, no luck there either. Does anyone know any python hierarchical clustering toolkit that has customizable linkage?

$\endgroup$
0
$\begingroup$

Fork sklearn and implement it yourself! The linkage function is referenced in cluster/hierarchical.py as

join_func = linkage_choices[linkage]

and

coord_col = join_func(A[i], A[j], used_node, n_i, n_j)

If you have time, polish your code and submit a pull request when you're done.

| improve this answer | |
$\endgroup$
0
$\begingroup$

It's not Python, but ELKI allows customizing linkages easily.

I used this tutorial:

http://elki.dbs.ifi.lmu.de/wiki/Tutorial/HierarchicalClustering#Addingadditionallinkagestrategies

The Lance-Williams-Uodate approach is very efficient. But I don't think you can easily add Minimax Linkage the same way. It may be much more expensive to do minimax linkage?

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.