You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, the output of hierarchichal clustering results can be determined either by number of clusters, or by the a distance thereshold to cut the tree at that threshold. However, scikit learn only supports one way!
class sklearn.cluster.AgglomerativeClustering(n_clusters=2, ...
As a suggestion, is it possible to add the other option, to give distance_threshold as input argument and get as many clusters are created in the output! So, one of this argument should be given, either n_clusters or the threshold, not both!
Reacted by Antogin, Abhinandan Srivastava and stone
You might also review some of the literate on graph modularity as a more robust measure of cluster quality. The igraph package (with python bindings) has a large number of these functions available for reference.
Thanks @jnothman
I saw that @vmichel has made the necessary changes for a distance threshold (and no PR?), but I was interested in the criterion that scipy.fcluster uses (mention by @eyaler) and was wondering if that would be useful along with the distance threshold. Or is it a feature of it's own?
Activity
agramfort commentedon Oct 23, 2014
sure it is possible !
code is open and we always welcome good contributions...
eyaler commentedon Feb 5, 2015
actually there are more options for the stopping/threshold criteria:
https://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.cluster.hierarchy.fcluster.html#scipy.cluster.hierarchy.fcluster
http://www.mathworks.com/help/stats/cluster.html
the inconsistency coefficient seems interesting and is the default in matlab and scipy...
mjbommar commentedon Feb 5, 2015
You might also review some of the literate on graph modularity as a more robust measure of cluster quality. The igraph package (with python bindings) has a large number of these functions available for reference.
Some discussion here also re: clustering and "communitiy detection", agglomerative/divisive/spectrall approaches, etc.:
http://arxiv.org/abs/0906.0612
http://bommaritollc.com/2012/06/summary-community-detection-algorithms-igraph-0-6/
Add distance threshold on Hierarchical Clustering, see scikit-learn#3796
Add distance threshold on Hierarchical Clustering, see scikit-learn#3796
VathsalaAchar commentedon May 11, 2017
Do you mind if I pick this up? I have implemented clustering in C++ years ago so I'll brush up and get back with questions.
jnothman commentedon May 11, 2017
VathsalaAchar commentedon May 12, 2017
Thanks @jnothman
I saw that @vmichel has made the necessary changes for a distance threshold (and no PR?), but I was interested in the
criterionthatscipy.fclusteruses (mention by @eyaler) and was wondering if that would be useful along with the distance threshold. Or is it a feature of it's own?jnothman commentedon May 13, 2017