Skip to content

Hierarchical clustering: distance threshold #3796

Closed

Description

@kmehrad

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!

Activity

  1. agramfort commented on Oct 23, 2014

    @agramfort
    Member

    sure it is possible !

    code is open and we always welcome good contributions...

  2. mjbommar commented on Feb 5, 2015

    @mjbommar
    Contributor

    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/

  3. VathsalaAchar commented on May 11, 2017

    @VathsalaAchar
    Contributor

    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.

  4. jnothman commented on May 11, 2017

    @jnothman
    Member
  5. VathsalaAchar commented on May 12, 2017

    @VathsalaAchar
    Contributor

    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?

  6. jnothman commented on May 13, 2017

    @jnothman
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions